Re: include question
| From: | Scott | Date: | Tue, 18 Sep 2001 02:26:03 +0000 |
| Subject: | Re: include question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67669@lists.php.net to get a copy of this message | ||
At 02:03 AM 9/18/2001 +0200, Chris Hayes wrote:
2) let them make a real template, either a file or a database cell, for instanceChris- YOU ROCK! Thank you for the thought starter, I have been beating my head on this most of the day. I have to confess that this site was done in ASP and I have been moving parts over to PHP and was not thinking clearly. I was thinking I was still under the ASP limitations :) Anyway, here is the code I am using. I will keep the templates in the db and call them, but I put a [BODY DATA] block in the template file, and then do a string replace as such: $temp = str_replace("[BODY DATA]", $body,$template); echo $temp; Can anyone tell me the limit or format to do multiple replaces, example: I have 5 fields that I need to replace, do I create a variable for each replacement? $temp = str_replace("[BODY DATA]", $body,$template); $temp2 = str_replace("[TOP_GRAPHIC]",$top_graphic, $temp); and so on -OR- can I do it in one statement?fhkhfsa<kuhfew>hehfaa<lkuhfwe>[DATA1]</lkuhfwe>and do a str replace [DATA1] parts --> database content.