note 45949 added to function.preg-replace

From: Date: Fri, 24 Sep 2004 10:43:47 +0000
Subject: note 45949 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-77305@lists.php.net to get a copy of this message
Supplement for note by Jinx: The code <? preg_replace("/\\[(.*?)\\]/e", "\\$assoc['\\\\1']", $str ); ?> produces an error-message: "parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING". Using '$assoc[\'\\1\']' as the second argument fixes this problem. ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+45949 Delete -- http://master.php.net/manage/user-notes.php?action=delete+45949&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+45949&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#77305) next »