php get static url and get section of url
<p>How do you get the routed url that is static, when I use $_SERVER["PHPSELF"] it returns that actual page of the url like for e.g</p>

<pre><code>/show_products.php
</code></pre>

<p>but the url I have is this</p>

<pre><code>http://mysite.com/browse/department/?pid=1&amp;order_by=a_z&amp;filter=1
</code></pre>

<p>what I want to get from the url is just this</p>

<pre><code> http://mysite.com/browse/department/
</code></pre>

<p>and also I would like to be able to just get the department section of the url so there is two parts to my question</p>
