Get the path with query string on the current http request in PHP [duplicate]

You want $_SERVER['REQUEST_URI']. From the docs:

'REQUEST_URI'

The URI which was given in order to access this page; for instance, '/index.html'.

Leave a Comment