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'
.
More Related Contents:
- URL Redirect / URL Masking [closed]
- URL rewriting with PHP
- Get the full URL in PHP
- PHP validation/regex for URL
- Passing base64 encoded strings in URL
- How can I check if a URL exists via PHP?
- Replace URLs in text with HTML links
- Passing arrays as url parameter
- Why is the hash part of the URL not available on the server side?
- Get Last Part of URL PHP
- How to get URL of current page in PHP [duplicate]
- Passing multiple variables to another page in url
- How to get the previous url using PHP
- Need a good regex to convert URLs to links but leave existing links alone
- Apache rewrite – get original URL in PHP
- What are fragment URLs and why to use them?
- Get current domain
- PHP Application URL Routing
- What is the “?” symbol in URL used for in php?
- PHP URL Encoding / Decoding
- PHP – Add link to a URL in a string
- How to get ¤ to display literally, not as an HTML entity
- What does the dot-slash do to PHP include calls?
- PHP – Convert File system path to URL
- PHP: How to resolve a relative url
- PHP & Hash / Fragment Portion of URL
- getting the full url including the query string after hash
- Regular Expressions: How to Express \w Without Underscore
- Extract URL’s from a string using PHP [duplicate]
- Pretty URLs without mod_rewrite, without .htaccess