How can I take the YouTube embedded code that YouTube provides and use a regular expression to convert it to valid FBML code, that is, use the fb:swf
tag?
So far the regular expression I've come up with is:
preg_replace('/<object(.*)<\/object>/i', "Whatever I need here...", $str);
I know it's lame, but it's my first try.
PS: Sample of the YouTube embedded 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>