note 16483 deleted from function.preg-replace by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 12:29:21 +0000 |
| Subject: | note 16483 deleted from function.preg-replace by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57467@lists.php.net to get a copy of this message | ||
Note Submitter: dummy@notme.com
----
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