note 19831 added to function.preg-replace
| From: | jmay at php2 dot chek dot com | Date: | Tue, 12 Mar 2002 17:12:44 +0000 |
| Subject: | note 19831 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27676@lists.php.net to get a copy of this message | ||
Just a note to save someone else a headache like mine on an obscure problem... I was parsing vars
from a form, and converting to mixed case like:
$a= preg_replace("/([A-Za-z]{1})([A-Za-z]+)/e",
"strtoupper($1).strtolower($2)",
$a);
and got a one-in-a-million parse error on an address like 1234 Sunset Lane. See why? First word,
2nd part is 'unset', and the reserved word caused the error! Make sure to add single
quotes around this kind of stuff.
--
http://www.php.net/manual/en/function.preg-replace.php
http://master.php.net/manage/user-notes.php?action=edit+19831
http://master.php.net/manage/user-notes.php?action=delete+19831
http://master.php.net/manage/user-notes.php?action=reject+19831