note 50067 added to function.preg-quote

From: Date: Thu, 17 Feb 2005 04:35:56 +0000
Subject: note 50067 added to function.preg-quote
Groups: php.notes 
Request: Send a blank email to php-notes+get-85146@lists.php.net to get a copy of this message
Another character that preg_quote will not escape is the all important "/" character. You will need to convert "/" into "\/" yourself. For example, this code does not work: <? $TEXT = preg_replace('/[' . preg_quote('abc/') . ']/', '', $TEXT); ?> However, this does: <? $TEXT = preg_replace('/[' . preg_quote('abc') . '\/]/', '', $TEXT); ?> ---- Manual Page -- http://www.php.net/manual/en/function.preg-quote.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50067 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50067&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50067&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50067&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50067&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50067&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50067&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85146) next »