Get Last Part of URL PHP

The Solution to Get Last Part of URL PHP is

The absolute simplest way to accomplish this, is with basename()

echo basename('');

Which will print


Of course, if there is a query string at the end it will be included in the returned value, in which case the accepted answer is a better solution.

~ Answered on 2012-01-04 08:47:37

Most Viewed Questions: