note 18159 added to function.preg-replace

From: Date: Sat, 12 Jan 2002 12:34:02 +0000
Subject: note 18159 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-24741@lists.php.net to get a copy of this message
Note the there is an implicit addslashes done to all matches when using the e-modifier for security reasons. If you're working with strings that may have single or double quotes, be sure to use an explicit stripslashes on your matches. Example: $string = preg_replace('/<([^>]+)>/e', 'processing_function(stripslashes("\1"))', $string); -- http://www.php.net/manual/en/function.preg-replace.php http://master.php.net/manage/user-notes.php?action=edit+18159 http://master.php.net/manage/user-notes.php?action=delete+18159 http://master.php.net/manage/user-notes.php?action=reject+18159

« previous php.notes (#24741) next »