note 21369 added to function.preg-replace

From: Date: Fri, 10 May 2002 00:46:54 +0000
Subject: note 21369 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-30409@lists.php.net to get a copy of this message
Being a novice in php, I ran into a lot of difficulties using preg_replace... the difference from perl is that you have the regex in a string "...regex...". so when using special characters, you have to escape <i>twice</i> for example, to replace all $ by \$ you have to do: $Entry = preg_replace("/\\$/", "\\\\$", $Entry); -- http://www.php.net/manual/en/function.preg-replace.php http://master.php.net/manage/user-notes.php?action=edit+21369 http://master.php.net/manage/user-notes.php?action=delete+21369 http://master.php.net/manage/user-notes.php?action=reject+21369

« previous php.notes (#30409) next »