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
  • 525
  • 1
  • 6
  • 20

2 Answers2

2

You can use substr/strrpos-

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

Demo

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
0

Try this one

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