Get the value of a URL after the last slash
<p>All,
Say I have the following URL values:</p>

<p><a href="http://website.com/tagged/news/" rel="nofollow">http://website.com/tagged/news/</a>
<a href="http://website.com/tagged/news" rel="nofollow">http://website.com/tagged/news</a>
<a href="http://www.website.com/tagged/news/" rel="nofollow">http://www.website.com/tagged/news/</a>
<a href="http://www.website.com/tagged/news" rel="nofollow">http://www.website.com/tagged/news</a></p>

<p>I'd like to have a PHP function to get news in this example. So I want the value after the last slash if it isn't blank and if that value is blank, then I'd like to get the value before that slash.</p>

<p>I found this post:
<a href="http://stackoverflow.com/questions/5921075/get-last-word-from-url-after-a-slash-in-php">Get last word from URL after a slash in PHP</a></p>

<p>But I'd like to be really sure just in case someone types a slash at the end of the URL.</p>
