note 79509 deleted from function.preg-replace by nlopess
| From: | nlopess@php.net | Date: | Fri, 30 Nov 2007 22:52:10 +0000 |
| Subject: | note 79509 deleted from function.preg-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-132708@lists.php.net to get a copy of this message | ||
Note Submitter: riseofthethorax at gmail dot com
----
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..