Re: copy from DB with '$' in it

From: Date: Sun, 24 Nov 2002 11:08:33 +0000
Subject: Re: copy from DB with '$' in it
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11055@lists.php.net to get a copy of this message
I think your problem is similar the bug #20392 (http://bugs.php.net/bug.php?id=20392). Quoting from the last post there: ------------------------------ $1 to $99 are used by preg_replace in the replacements arguments (see: http://fr2.php.net/manual/en/function.preg-replace.php). $t = new HTML_Template_IT(); $t->setTemplate('{x}', TRUE, TRUE); $t->setVariable('x', 'I have $a in my pocket'); $t->show(); ------------------------------ It seems that you have to replace al the $[0-9]+ variables with ones that have strings for names. Stijn de Reede Erica Cirigliano wrote:
Hello (again), I am pulling a chunk of copy out of a database and displaying it in an HTML template. There are some '$' symbols within the copy. If I echo the result, everything displays fine. But if I do this: $tpl->setVariable("ITEMCOPY", $sectionresult[4]); the amount '$30' becomes '' and the amount '$150' becomes '0'. I have tried backslashes to escape the character, but SQL strips them out when I upload the text to the database, so they still get parsed (at least, I think that's what's happening). I'd appreciate any help or ideas on this. Thanks very much. Erica


« previous php.pear.dev (#11055) next »