note 11459 rejected from function.preg-replace by joey
| From: | joey@php.net | Date: | Mon, 02 Jun 2003 15:49:22 +0000 |
| Subject: | note 11459 rejected from function.preg-replace by joey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49573@lists.php.net to get a copy of this message | ||
Note Submitter: netben@free.fr
----
you can't include array with a reference to a captured pattern as a key into the replacement
string.
for example:
preg_replace("/blabl(.*?)blo(.*?)/",$array[$1],$contents);
i tried with \\1 , no results.
with the \e modifier (blbla.$array[1].blbl) .
the solution was using /F modifier , and creating a special function...