note 72517 deleted from function.preg-replace by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 20:08:04 +0000 |
| Subject: | note 72517 deleted from function.preg-replace by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127717@lists.php.net to get a copy of this message | ||
Note Submitter: congaz at yahoo dot dk
----
If you want to use preg_replace with the e modifier in an OO-invironment, remember to escape the
dollar sign before your object-reference:
<?php
$output = preg_replace("#(pattern)#e",
"\$this->replaceMatch('$0')", $input);
?>
Although this may seem obvious for some, it escaped me (ha ha) for quite some time, going through
trial and error...
Regards,
Michael.