-2

I've a input form which i want to post a youtube video link. For example:

http://www.youtube.com/watch?v=0MMNsUgaUd0&NR=1&feature=endscreen
or
http://youtu.be/0MMNsUgaUd0

So, whatever link i provided in the input box it's should be show a video on my website. How can i do this with php. Any Idea?

mauris
  • 42,982
  • 15
  • 99
  • 131
user1161867
  • 141
  • 1
  • 1
  • 11

1 Answers1

0

use preg_replace (http://php.net/manual/en/function.preg-replace.php) this will search the youtube url and replace with youtube object code.

PHP Connect
  • 539
  • 2
  • 7
  • 24