note 45949 deleted from function.preg-replace by aidan
| From: | aidan@php.net | Date: | Tue, 07 Dec 2004 03:10:39 +0000 |
| Subject: | note 45949 deleted from function.preg-replace by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-81464@lists.php.net to get a copy of this message | ||
Note Submitter: soren at erland dot dk
----
Supplement for note by Jinx:
The code
<?
preg_replace("/\\[(.*?)\\]/e", "\\$assoc['\\\\1']", $str );
?>
produces an error-message: "parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING".
Using '$assoc[\'\\1\']' as the second argument fixes this problem.