Código PHP:
$patron = '#\[youtube\]((.*?)watch?v=(.*?))\[/youtube\]#i';
$formato = '<iframe width="640" height="390" frameborder="0" src="$1embed/$2" allowfullscreen></iframe>';
$str = preg_replace($patron, $formato, $str);
este codigo deberia tomar el codigo bb
[youtube ]
http://www.youtube.com/watch?v=MmJFbrLNGG8[/youtube]
(agregue espacio en el primer youtube para evitar que el foro lo remplace)
y transformarlo en
<iframe width="640" height="390" frameborder="0" src="http://www.youtube.com/embed/MmJFbrLNGG8" allowfullscreen></iframe>
Pero no funciona.. alguien me ayuda!!