note 33155 deleted from function.preg-replace by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 21:56:43 +0000 |
| Subject: | note 33155 deleted from function.preg-replace by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55670@lists.php.net to get a copy of this message | ||
Note Submitter: david@turningminds.com
----
I just spent a good half hour debugging an unusual problem with preg_replace... the task was to
insert text from a textarea into a template and send it along in an email. If the user put a $
anywhere in the textarea, the output would be hosed. Anywhere they had $ followed by a price, it
would replace it with 0.
My best guess at this is that it interprets the prices as matched values (ie $0, $1, etc). My only
solution was to NOT use a regexp and just use str_replace, since I didn't NEED regular
expressions.