Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/01/2006, 14:18
Avatar de Seppo
Seppo
 
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años
Puntos: 17
después de ver el tema por un buen rato, leí en las contribuciones de php.net algo interesante...
Cita:
Sometimes when you format your own code with the squared bracets [ and ] your code will contain new lines, but the (.*?) will not work because . (dot) accepts everything but a new line (talk about bad luck), you can add the new line manually like that ((.|\n)*?). It took me a while to figure it out without any experience.
Fuente

Conclusión:
$textolimpio = preg_replace("/\<!-- inicio --\>((.|\n)*?)\<!-- fin --\>/", "", $texto);