Don't print last segment of URL
<p>I have some php which prints a url. Can I contain this with PHP to leave off the last segment?</p>

<p>So this:</p>

<pre><code>www.mysite.com/name/james
</code></pre>

<p>would become this:</p>

<pre><code>www.mysite.com/name
</code></pre>

<p>I'm using expression engine so the code is just {site_url}. </p>
