Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/04/2010, 17:05
Avatar de CHuLoSoY
CHuLoSoY
 
Fecha de Ingreso: febrero-2002
Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 22 años, 3 meses
Puntos: 29
Respuesta: Expresión regular para reemplazar variable en texto

Código PHP:
Ver original
  1. $mensaje="un monton de texto $variable un monton de texto $variable";
  2. $mensaje=preg_replace("/\$\w+/", "<font color='blue'>\\0</font>", $mensaje);
Gracias pateketrueke
__________________
ESQUIO Dominios y Hosting
Las mejores características con los mejores precios.