Posted by Geoff Berrow on 12/04/06 17:35
Message-ID: <45744754$0$17867$c3e8da3@news.astraweb.com> from
Promextheus Xex contained the following:
>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.
PHP has loose typing and can easily deal with that.
e.g.
$string1 = " 5";
$string2 = 2;
echo $string1+$string2;
//outputs 7
Your problem is elsewhere.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Navigation:
[Reply to this message]
|