RE: variable placeholders in a text file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> While using the *_once works in many cases, if you're doing a mass
> mailing kind of thing, you want to use the standard include/require so
> you can re-include it as your variables change:
>
> foreach ($customers as $customer) {
> $fullname = $customer['fullname'];
> $address = $customer['address'];
> // and so on
> include("mailing.php");
> process($mailing,$customer);
> }
>
> where mailing.php defines the $mailing variable as the content that
> got included and substituted.
>
> (Back before I came up with this, I was starting off in the same place
> as the OP -- and then I just realized "wait --- PHP *IS* a templating
> system!" a voila)

For what I am trying to do here, I think what I'm doing will suffice. Like you
did, I am going through the learning process. What I've read about templating
has whetted my appetite for bigger and better things, but I should probably
finish this first. Right now I'm just trying to personalize a rather dry
page just a bit.

Thanks!
 		 	   		  
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux