復制代碼 代碼如下:
<?php
// 說明:獲取 _SERVER['REQUEST_URI'] 值的通用解決方案
function request_uri()
{
if (isset($_SERVER['REQUEST_URI']))
{
$uri = $_SERVER['REQUEST_URI'];
}
else
{
if (isset($_SERVER['argv']))
{
$uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['argv'][0];
}
else
{
$uri = $_SERVER['PHP_SELF'] .'?'. $_SERVER['QUERY_STRING'];
}
}
return $uri;
}
?>