explode string and get last code example Example: php explode end $url = explode("/", URL::current()); echo end($url);