note 40724 deleted from function.preg-replace by tularis

From: Date: Sun, 18 Jun 2006 13:19:10 +0000
Subject: note 40724 deleted from function.preg-replace by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-114326@lists.php.net to get a copy of this message
Note Submitter: php at equaliser dot net ---- If you're setting your replacement values elsewhere and your replacement value can contain a dollar sign followed by an integer eg: $replacement = 'Dad's $7 shoes' You'll find that preg_replace() treats this (quite rightly) as callback syntax. So, you might want to do this: $replacement = preg_replace("!" . '\x24' . "!" , '\\\$' , $replacement); To your replacement string first; Putting in an escaped backslash '\\' followed by an escaped dollar sign '\$' where every instance appears.

« previous php.notes (#114326) next »