note 79509 added to function.preg-replace
| From: | riseofthethorax at gmail dot com | Date: | Fri, 30 Nov 2007 20:22:59 +0000 |
| Subject: | note 79509 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132701@lists.php.net to get a copy of this message | ||
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..
----
Server IP: 69.147.83.197
Probable Submitter: 76.113.29.191
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/79509
Del: integrated -- https://master.php.net/note/delete/79509/integrated
Del: useless -- https://master.php.net/note/delete/79509/useless
Del: bad code -- https://master.php.net/note/delete/79509/bad+code
Del: spam -- https://master.php.net/note/delete/79509/spam
Del: non-english -- https://master.php.net/note/delete/79509/non-english
Del: in docs -- https://master.php.net/note/delete/79509/in+docs
Del: other reasons-- https://master.php.net/note/delete/79509
Reject -- https://master.php.net/note/reject/79509
Search -- https://master.php.net/manage/user-notes.php