I want the details after sitename from current URL.
For eg: if current url is http://mysite.com/a/article
, I want to get the content after http://mysite.com/
, in this case a/article
. Is there any PHP function to get these details?
I want the details after sitename from current URL.
For eg: if current url is http://mysite.com/a/article
, I want to get the content after http://mysite.com/
, in this case a/article
. Is there any PHP function to get these details?
echo $_SERVER['REQUEST_URI']; // will print /a/article
If you don't need the '/':
echo substr($_SERVER['REQUEST_URI'], 1); // will print a/article