Beiträge
Echo or get the current page URL in a PHP page, use $_SERVER. Its build-in variable in PHP, which is used to fetch or echo the current page URL. It’s available for all scope and its super global variable. The below examples show how it works and check URL on HTTPS or HTTP. <?php if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){ $url = 'https://'; }else{ $url = "http://"; } $u...

Get full current page URL in PHP

Feb 08, 2022
84 Aufrufe