How to get full url link in PHP?

$_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,
<?php
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;
?>

Post a Comment

Post a Comment (0)

Previous Post Next Post