need the last part of the url
http://example.com then the last part is nothing if it is http://example.com/i then last part is i if it is http://example.com/i/am/fil
Note that Vasil's example won't work if for some reason you have a trailing slash, as for instance some CMS systems will put at the end (Magento, I'm looking at you...)
Well, it'll work, but the end of the path is empty. Something to be aware of.