php获得当前的脚本网址
(编辑:jimmy 日期: 2024/11/19 浏览:3 次 )
//获得当前的脚本网址
function GetCurUrl(){
if(!empty($_SERVER["REQUEST_URI"])){
$scriptName = $_SERVER["REQUEST_URI"];
$nowurl = $scriptName;
}else{
$scriptName = $_SERVER["PHP_SELF"];
if(empty($_SERVER["QUERY_STRING"])) $nowurl = $scriptName;
else $nowurl = $scriptName."".$_SERVER["QUERY_STRING"];
}
return $nowurl;
}
下一篇:php代码把全角数字转为半角数字