Customize the request url in php
<p>I would like to highlight the current tab using the url</p>

<pre><code>$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

$gallerypageurl="http://www.domain.com/gallery/"; 
if ($gallerypageurl==$url){ echo "selected"; }else { echo "";} 
</code></pre>

<p>This highlights the gallery tab when the url is <em>http://www.domain.com/gallery/</em>
but my gallery has a pagination in that, so when I go to second page the url is <em>http://www.domain.com/gallery/2/</em>.</p>

<p>This won't highlight the current gallery tab because the $url (<em>http://www.domain.com/gallery/2/</em>) is not equal to $gallerypageurl (<em>http://www.domain.com/gallery/</em>).</p>

<p>How do you extract only the page url without the page number /2/ or /3/</p>
