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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.