Possible Duplicate:
Extracting the last segment on an URI
I want to get the last parameter of the url for eg.
http://www.youtube.com/embed/ADU0QnQ4eDs
I have a full url like above and i want to get only last parameter with the PHP which is ADU0QnQ4eDs
Please help
Something like this?
echo end(explode("/", $url));
This will throw an error if strict error reporting is enabled. To avoid this, split them up like this:
$parts = explode("/", $url);
echo end($parts);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With