You can use the PHP function parse_url()to split the url for you and then access the parameter pathand get its end
$r = parse_url($url);
$endofurl = substr($r['path'], strrpos($r['path'], '/'));
This will parse the URL and then take the “substring” of the URL, starting with the last found /in the path.
explode('/'), :
$path = explode($r['path']);
$endofurl = $path[count($path) - 1];
( strrchr(), @x4rf41):
, substr() + strrpos(), strrchr():
$endofurl = strrchr($r['path'], '/');
parse_url(), , PHP_URL_PATH like
$ r = parse_url ($ url, PHP_URL_PATH);
:
$endofurl = strrchr(parse_url($url, PHP_URL_PATH), '/');