Re: [PHP-ES] problemas con str_replace en php5
[email protected] (David Fraga)
| Newsgroups | php.general.es |
|---|---|
| Organization | nemondemand.com |
| Message-ID | <[email protected]> |
¿qué contiene $texto originalmente?
El 11/10/11 15:50, Omar Steffen escribió:
> Hola amigos espero me puedan dar una mano, tengo este script que corre en php 4 sin problemas pro no me muestra las imagenes en php5 y no le encuentro el error, espero respuesta, desde ya muchas gracias
>
> <?php
> //================Aca empieza el baile " Busco y reemplazo #i " =============
> $texto=$row_rstrabajos['nota'];
> $i=1;
> $x=2;
> $string1="#$i#";
> $imagen=$row_rstrabajos['imagen'];
> $string2="<center><img src=\"imagenes/noticias/$imagen\"></center>";
> $texto = str_replace ($string1, $string2, $texto);
> for ($i = 2; $i <= 10; $i++) {
> $string1="#$i#";
> $imagen=$row_rstrabajos['imagen$x'];
> $string2="<center><img src=\"imagenes/noticias/$imagen\"></center>";
> $texto = str_replace ($string1, $string2, $texto);
> $x=++$x;
> }
> echo $texto;
> //================Aca termina el baile " Busco y reemplazo #i " =============
> ?>