Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/02/2017, 10:26
Avatar de blogger
blogger
 
Fecha de Ingreso: diciembre-2005
Ubicación: frente al monitor
Mensajes: 398
Antigüedad: 20 años, 10 meses
Puntos: 12
Respuesta: remplazar string en variable

He intentado el bucle de dos maneras.

Aquí les muestro las dos formas de hacer el bucle, el resultado es el mismo:

Código PHP:
$count=count($enlace);
$x = 0;
WHILE (
$x <= $count) {
    
$match = current($enlace);
    
$quest = '<a href="http://exegesis-biblica.com/search.php?search='.$match.'">'.$match.'</a>';
    
$articulo =  str_replace($match, $quest, $articulo);
    
next($enlace);
    
$x++;
} 
Código PHP:
foreach ($enlace as $valor) {
    
$quest = '<a href="http://exegesis-biblica.com/search.php?search='.$valor.'">'.$valor.'</a>';
    
$articulo =  str_replace($valor, $quest, $articulo);
} 
¿Qué estoy haciendo mal o porqué no quiere funcionar?
__________________
http://exegesis-biblica.com/