3

requesturi

request_uri
SYNOPSIS

request_uri()

DESCRIPTION
CODE
  1. function request_uri() {
  2.     if (isset($_SERVER['REQUEST_URI'])) {
  3.         $uri = $_SERVER['REQUEST_URI'];
  4.     }
  5.     else {
  6.         if (isset($_SERVER['argv'])) {
  7.             $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];
  8.         }
  9.         elseif (isset($_SERVER['QUERY_STRING'])) {
  10.             $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];
  11.         }
  12.         else {
  13.             $uri = $_SERVER['SCRIPT_NAME'];
  14.         }
  15.     }
  16.  
  17.     $uri = '/'. ltrim($uri, '/');
  18.  
  19.     return $uri;
  20. }
SEE ALSO

engine

Comments

To add a comment, click here.