php得到当前页面的完整地址
php得到当前页面的完整地址 ```{php}function full_url(){$s = empty($_SERVER[quot;HTTPSquot;]) ? #39;#39; : ($_SERVER[quot;HTTPSquot;] == quot;onquot;) ? quot;squot; : quot;quot;;$protocol = substr(strtolower($_SERVER[quot;SERVER_PRO
function full_url() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']; }
精彩图集
精彩文章