
If you are coding in php, sometimes you might want to get the current URI without the querystring. For example, if the URL is www.mysite.com/page?test=cool, you want to be able to get just the /page part of the URL and ignore everything after that. This quick post will show you how to do that.
The Code
1 |
strtok($_SERVER['REQUEST_URI'],'?'); //if the url is www.mysite.com/page?test=cool, this will return /page |