php $_SERVER["REQUEST_URI"]获取值的通用解决方法
程序员文章站
2022-06-12 18:18:38
复制代码 代码如下:
<?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;
}
?>
复制代码 代码如下:
<?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;
}
?>
推荐阅读
-
php $_SERVER["REQUEST_URI"]获取值的通用解决方法
-
php $_SERVER["REQUEST_URI"]获取值的通用解决方法
-
php $_SERVER["REQUEST_URI"]获取值的通用解决方法_PHP教程
-
request timed out php $_SERVER["REQUEST_URI"]获取值的通用解决方法
-
php $_SERVER["REQUEST_URI"]获取值的通用解决方法_PHP教程
-
php $_SERVER["REQUEST_URI"]获取值的通用解决方法_php技巧
-
php $_SERVER["REQUEST_URI"]获取值的通用解决方法_php技巧