Posted by Promextheus Xex on 12/04/06 16:06
I'm having a problem with numbers. I'm getting a number from an array that
seems to have a padded space at the beginning.
IE: " 5"
What I've done was $var = ltrim($var) which removes the space but with one
problem. Now I think PHP thinks it's a sting and not a number.
Then I try $var = settype($var, "integer") to see if it will become a
numeric for addition purposes.
Next problem... $var is now 0 and gettype($var) shows its and integer.
Why would it be 0 and not 5? Perhaps there's an obvious starring right at
me and I'm not seeing it?
- Francis
Navigation:
[Reply to this message]
|