{% else-1 %}

                        
function selfURL(){
if(!isset($_SERVER['REQUEST_URI'])) $suri = $_SERVER['PHP_SELF'];
else $suri = $_SERVER['REQUEST_URI'];
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$sp=strtolower($_SERVER["SERVER_PROTOCOL"]);
$pr = substr($sp,0,strpos($sp,"/")).$s;
$pt = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $pr."://".$_SERVER['SERVER_NAME'].$pt.$suri;
}

echo selfURL();
6 48 0
Без комментариев...