note 85588 deleted from function.preg-replace by danbrown

From: Date: Mon, 20 Jun 2011 15:29:22 +0000
Subject: note 85588 deleted from function.preg-replace by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180772@lists.php.net to get a copy of this message
Note Submitter: http://www.webb3.net/ ---- 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>

« previous php.notes (#180772) next »