Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: So simple yet so tricky
01-24-2007, 03:50 AM #1
- Join Date
- Jan 2007
- Thanked 0 Times in 0 Posts
So simple yet so tricky
This might be a dumb question, but here it is anyway.
I am using PEAR package HTML_Template_IT. It's basically a template engine like Flexy or Smarty. When I attempt to print strings that have the dollar sign ($) in the string, I seem to lose them.
For example, if I have a form w/POST method and I try to display the value, say "$300/hr":
I only see "0/hr".
I tried so many methods... one method that I saw was suggested here: http://www.php.net/str_replace
They recommend using single quote string, not double quote string, but i don't know how to convert $_POST variables into single quote string..(is there a way?).
Any suggestion is appreciated.
Last edited by kimtd; 01-24-2007 at 04:00 AM.
01-24-2007, 06:09 AM #2
- Join Date
- Dec 2005
- Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
- Thanked 637 Times in 625 Posts
Maybe you are losing the "$" because the template engine is interpreting it as a replacement variable. Try escaping it with a backslash( \$ ) or using two in a row ( $$ ) ... those are two common methods of escaping symbols that otherwise are interpreted in other ways.
01-24-2007, 12:13 PM #3
Or you can use the $ html entity(sp) for $