Hey folks - I'm not much of a coder, but I need to write a simple preg_replace statement in PHP that will help me with a wordpress plugin. Basically I need code that will search for a string, pull out the video id, and return the embed code with the video id inserted into it.
So in other words...
I'm searching for this:
[youtube=http://www.youtube.com/watch?v=VIDEO_ID_HERE&hl=en&fs=1]
And want to replace it with this (keeping the video id the same):
param name="movie" value="http://www.youtube.com/v/VIDEO_ID_HERE&hl=en&fs=1&rel=0
If possible, I'd be forever grateful if you could explain how you've used the various slashes, carrots, and stars in the search pattern, ie, translate it from grep to English so I can learn. :-)
Thanks!
Mike