Home >Backend Development >PHP Tutorial >General solution for request timed out php $_SERVER['REQUEST_URI'] to obtain the value
Copy the code The code is as follows:
// Description: A general solution to get the _SERVER['REQUEST_URI'] value
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;
}
?>
The above introduces the general solution for request timed out php $_SERVER["REQUEST_URI"] to obtain the value, including the content of request timed out. I hope it will be helpful to friends who are interested in PHP tutorials.