Php Get Last Folder Name from Url

Getting last folder name could seem as a complex process.

But getting last folder name is so easy process. If you search it on google, you can find lots of various answers on stackoverflow. You need just a function which is basename()

[php]
$url = "http://stackoverflow.com/questions/7395049/get-last-part-of-url-php";
echo basename($url);
//get-last-part-of-url-php
[/php]