I would like to highlight the current tab using the url
$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$gallerypageurl="http://www.domain.com/gallery/";
if ($gallerypageurl==$url){ echo "selected"; }else { echo "";}
This highlights the gallery tab when the url is http://www.domain.com/gallery/
but my gallery has a pagination in that, so when I go to second page the url is http://www.domain.com/gallery/2/.
This won’t highlight the current gallery tab because the $url (http://www.domain.com/gallery/2/) is not equal to $gallerypageurl (http://www.domain.com/gallery/).
How do you extract only the page url without the page number /2/ or /3/
You could use (for example…)
stristr: