note 23587 added to function.preg-replace
| From: | guidod at gmx dot de | Date: | Tue, 23 Jul 2002 10:07:00 +0000 |
| Subject: | note 23587 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33412@lists.php.net to get a copy of this message | ||
always remember that the capture-texts $1..$n are run through addslashes() for the /e-case,
converting \,'," into \\,\',\". The /e-val will handle quotations however
reducing just two of the three backslashes back for quoted $1..$n-arguments
"my_func(\"$1\")" reduces \\ and \" but not \'
"my_func('$1')" reduces \\ and \' but not \"
Therefore the remaining escaped quotationmark is seen by the function and a str_replace
'\"','"', must be used there to get at the original captured text.
--
http://www.php.net/manual/en/function.preg-replace.php
http://master.php.net/manage/user-notes.php?action=edit+23587
http://master.php.net/manage/user-notes.php?action=delete+23587
http://master.php.net/manage/user-notes.php?action=reject+23587