Re: evaluating vars in a var

From: Date: Fri, 06 Dec 2002 22:37:21 +0000
Subject: Re: evaluating vars in a var
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127340@lists.php.net to get a copy of this message
$htmlEmail = '<html><body><span class=\'someclass\'>hello $firstName $lastName</span></body></html>'; //Start loop eval("\$thisemail = $htmlemail"); //Send mail out, using $thisemail for mail body //End loop rolf vreijdenberger wrote:
Hi, this problem came forth from my previously posted -Mail(): how much time-, but is different so I posted it seperately. I make html emails with personal stuff in it e.g. <span class='someclass'>hello $firstName $lastName</span> etc. Problem: I would like to put the whole email html layout in one var, like this: $htmlEmail = "<html><body><span class='someclass'>hello $firstName $lastName</span></body></html>"; and then I want to have the values of firstName and $lastName updated in every iteration of a loop where I put in new Values of these vars. In order to do this, I have to reevaluate the whole $htmlEmail variable. Is this possible, and if so, how? thanks a lot
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

« previous php.general (#127340) next »