note 87344 added to function.preg-replace
| From: | Borey at osu1 dot php dot net | Date: | Mon, 01 Dec 2008 09:21:01 +0000 |
| Subject: | note 87344 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147477@lists.php.net to get a copy of this message | ||
Hello I am the admin of http://www.carsellers.ru/ 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.carsellers.ru">пÑодажа
авÑо</a>
----
Server IP: 195.54.192.44
Probable Submitter: 127.0.0.1
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/87344
Del: integrated -- https://master.php.net/note/delete/87344/integrated
Del: useless -- https://master.php.net/note/delete/87344/useless
Del: bad code -- https://master.php.net/note/delete/87344/bad+code
Del: spam -- https://master.php.net/note/delete/87344/spam
Del: non-english -- https://master.php.net/note/delete/87344/non-english
Del: in docs -- https://master.php.net/note/delete/87344/in+docs
Del: other reasons-- https://master.php.net/note/delete/87344
Reject -- https://master.php.net/note/reject/87344
Search -- https://master.php.net/manage/user-notes.php