Google
Web dns.bdat.net

[PHP-ES] Re: reemplazar caracteres

From: Arkrelod (segoritek(EN)hotmail.com)
Date: Sun Sep 26 2004 - 20:36:07 CEST


Cristian Soto escribió:
> Hola a todos,
>
> consulta: necesito sustituir caracteres en una cadena utilizando el
> comando ereg_replace u otro?, existe algun caracter especial o algo que
> me permita remplazar varios caracteres de una vez, ocurre que tengo que
> eliminar las etiquetas de imagen de varios registros. EJ:
>
> $texto=<img align=left border=1 hspace=3 src=imagen.jpg >;
> $texto= ereg_replace( "<img ???? >", "", $texto);
>
> Gracias,
> Cristian Soto
>
>
>

$patron="<img [^<>]+>";
$texto=ereg_replace($patron,"",$texto);

Espero que te sirva. Cuidadín con mayúsculas y minúsculas, por si acaso
podrías utilizar eregi_replace que ignorará si en el texto hay <img o <IMG

Dime si te sirve. Saludos

-- 
PHP Spanish Localization Talk Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


This archive was generated by hypermail 2.1.7 : Fri Nov 12 2004 - 20:21:30 CET