note 16483 added to function.preg-replace

From: Date: Thu, 01 Nov 2001 12:39:38 +0000
Subject: note 16483 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-19977@lists.php.net to get a copy of this message
When using a template to fill in posted parameters (via url) i use following:<p> $fcontents = join ('', file('filename.txt'));<br> $str = preg_replace("/(.*?)(%%output name=)(.*?)(%%)(.*?)/i","\\1\$HTTP_POST_VARS[\\3]\\5",$fcontents);<br> eval ("\$str = \"$str\";");<p> Then $str will contain the parsed text. In 'filename.txt' i use following %%output name=parameter%% that will be replaced by the corresponding paramter<p>/EA -- http://www.php.net/manual/en/function.preg-replace.php http://master.php.net/manage/user-notes.php?action=edit+16483 http://master.php.net/manage/user-notes.php?action=delete+16483 http://master.php.net/manage/user-notes.php?action=reject+16483

« previous php.notes (#19977) next »