note 79510 deleted from function.preg-replace by danbrown
| From: | danbrown@php.net | Date: | Fri, 28 Nov 2008 19:50:07 +0000 |
| Subject: | note 79510 deleted from function.preg-replace by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147146@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
This code is much easier than preg_replaces current implementation, I stole some of this from
someone else here, but to make it more explicit:
$relation['/pattern/'] = "replacement";
$text_out = preg_replace(array_keys($relation), array_values($relation), $text_in);
Fast, efficient, no guess work..