Request string without GET arguments

In PHP, you can use the $_SERVER['REQUEST_URI'] variable to get the request string without GET arguments. For example, if the full URL being accessed is, you can use $_SERVER['REQUEST_URI'] to get /page.php.

Watch a course Learn object oriented PHP

You can also use parse_url function.

$url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

This will give you the path of the URL requested by the client.