[php] if (!empty($processed['body']) && preg_match('#(http://www.youtube.com)?/(v/([-|~_0-9A-Za-z]+)|watch\?v\=([-|~_0-9A-Za-z]+)&?.*?)#i', $processed['body'], $preg_text))
$processed['body'] = preg_replace('#(http://www.youtube.com)?/(v/([-|~_0-9A-Za-z]+)|watch\?v\=([-|~_0-9A-Za-z]+)&?.*?)#i', '<iframe width="560" height="315" src="http://www.youtube.com/embed/' . $preg_text . '" frameborder="0" allowfullscreen ></iframe>', $processed['body']);[/php]
I want to check if [tt]$processed[‘body’][/tt] contains this any URL with the pattern [tt]’#(http://www.youtube.com)?/(v/([-|~_0-9A-Za-z]+)|watch?v=([-|~_0-9A-Za-z]+)&?.*?)#i’[/tt] and if it does, it replaces that piece with [tt][/tt]… However, it keeps producing the following:
How do I accomplish what it is I want to do?