Re: Pattern matching and replacement!
| From: | heinisch at creaction dot de | Date: | Tue, 08 May 2001 08:34:06 +0000 |
| Subject: | Re: Pattern matching and replacement! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51872@lists.php.net to get a copy of this message | ||
At 08.05.01 10:03, you wrote:
Hello all, I have a slight problem. I am storing an email template in a MySQL DB. Portions of the email have text that need to be replaced with variable values when run through the script ex: <snip> Sehr geehrte(r) Frau/Herr {%Last_Name%} , Dies ist eine automatische Zusendung von ACNS Billing and Support Software. Ihre Zahlung von DM {%Prev_Total%} fuer ihr ACNS Domain und/oder ihr Internet Flatrate <snip>As you can see. I am using the {% and %} to delimit the parts that need to
be replaced. I can't get the replacements to work right though. Can someone help? why don´t you store something like:Sehr geehrte(r) Frau/Herr $Last_Name , an then use the eval() function, to fill your vars? Otherwise you have to str_replace() this {%Last_Name%}, think that would be more work. HTH Oliver