dc_jt Posted August 25, 2009 Share Posted August 25, 2009 Hi Can someone please help me with the following. I have a content area where I can add content and I want to embed a youtube video within the content. I am trying to do it so that if I type [youtube: http://www....com] then I can use preg_replace to get the embed code. Currently Im using the following function: return preg_replace('/\[youtube: ([^\]]+?)\]/', '<object width="560" height="340"><param name="movie" value="\\1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="\\1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>', $body); However this returns it in an incorrect format. I need to convert it from to =en&fs=1& Can anyone help? Thanks Link to comment https://forums.phpfreaks.com/topic/171797-youtube-embed-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.