删除对象标记但保留嵌入

I want have some videos like this:

<object style="display:block;margin-left:auto;margin-right:auto;" width="550" height="350" data="http://www.youtube.com/v/DlK5N-Lcvjc" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" />

And I want to remove everything except <embed> tag. Also around the video there is more content which I want to keep.

I was trying to make this with preg_replace but it didn`t work.

Use strip_tags(), it accepts as optional parameter an array with tags that should not be removed.

strip_tags($str,'<embed>');