note 85588 added to function.preg-replace

From: Date: Sun, 07 Sep 2008 12:16:49 +0000
Subject: note 85588 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-144213@lists.php.net to get a copy of this message
Hello I am the admin of http://www.webb3.net/ I got this function for templates. <?php $file = "filename.tpl"; $contents = file_get_contents($file); $website_tpl = 'something'; $text = preg_replace('/\{(\w+)\}/e', '$$1_tpl', $TEMPLATE); echo $text ?> With this if you have a file filename.tpl and you have the text {website} it will replace it with something as you can see above! -<a href="http://www.webb3.net">http://www.webb3.net/</a> ---- Server IP: 69.147.83.197 Probable Submitter: 213.7.106.197 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- https://master.php.net/note/edit/85588 Del: integrated -- https://master.php.net/note/delete/85588/integrated Del: useless -- https://master.php.net/note/delete/85588/useless Del: bad code -- https://master.php.net/note/delete/85588/bad+code Del: spam -- https://master.php.net/note/delete/85588/spam Del: non-english -- https://master.php.net/note/delete/85588/non-english Del: in docs -- https://master.php.net/note/delete/85588/in+docs Del: other reasons-- https://master.php.net/note/delete/85588 Reject -- https://master.php.net/note/reject/85588 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144213) next »