$_SERVER['HTTP_HOST'] = This will return server name from the URL.
$_SERVER['REQUEST_URI'] = This will return the full path of your directory.
The following example will give you clear idea,
$_SERVER['REQUEST_URI'] = This will return the full path of your directory.
The following example will give you clear idea,
<?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
?>
Post a Comment