<tutorialjinni.com/>

Get Full URL in PHP

Posted Under: PHP, Programming, Snippets on Nov 20, 2020
PHP code snippet to get the complete URL typed in the browser. It will get complete URL with query string.
<?php
$completeURL="//".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
echo completeURL;
?>
This will echo
https://www.tutorialjinni.com/get-full-url-in-php.html
© Tutorial Jinni