Get last parameter of url in php -


possible duplicate:
extracting last segment on uri

i want last parameter of url eg.

http://www.youtube.com/embed/adu0qnq4eds

i have full url above , want last parameter php adu0qnq4eds

please help

something this?

echo end(explode("/", $url)); 

this throw error if strict error reporting enabled. avoid this, split them this:

$parts = explode("/", $url); echo end($parts); 

Comments

Popular posts from this blog

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -