note 41631 deleted from function.preg-replace by tularis
| From: | tularis@php.net | Date: | Sun, 18 Jun 2006 13:20:00 +0000 |
| Subject: | note 41631 deleted from function.preg-replace by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-114328@lists.php.net to get a copy of this message | ||
Note Submitter: mike at iaym dot com
----
This took a few hours of my life. If you want to replace a string in a chunk of text WITHOUT
replacing it in the html tags use the following: (i used this for a search engine to search a news
database which includes html)
<?php
preg_replace("'(?!<.*?)$string(?![^<>]*?>)'si",
"REPLACED", $chunk);
?>