0

I have the following viemo url:

http://player.vimeo.com/video/5836196

How would I be able to get the last part of the url 5836196 using php?

Rob Morris
  • 515
  • 1
  • 5
  • 20

2 Answers2

2

You can use substr/strrpos-

substr( $url, strrpos( $url, '/' )+1 );

Demo

Sahil Mittal
  • 20,515
  • 12
  • 60
  • 89
0

Try this one

$url='http://player.vimeo.com/video/5836196';
echo end(explode('/', $url));
Anand Somasekhar
  • 586
  • 11
  • 20