Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2011, 13:17
Avatar de ColdFusion
ColdFusion
 
Fecha de Ingreso: octubre-2008
Ubicación: Tocoa, Colon Honduras C.A.
Mensajes: 419
Antigüedad: 15 años, 6 meses
Puntos: 9
preg_replace error

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!!