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

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -