I want to take the youtube embed code that youtube provides and use a regex to convert it to valid FBML code i.e. use the fb:swf tag. Has anyone done something like this? So far the regex I've come up with is :
preg_replace('/<object(.*)<\/object>/i', "Whatever I need here...", $str);
I know its lame but its my first try.
Thanks for the help in advance.
PS: Sample of the Youtube embed code
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/NWHfY_lvKIQ&hl=en_GB&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/NWHfY_lvKIQ&hl=en_GB&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>