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 instance
>         fhkhfsa<kuhfew>hehfaa<lkuhfwe>[DATA1]</lkuhfwe>
>and do a str replace [DATA1] parts --> database content.


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 
$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?

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to