You are here: Re: Alpha/Numeric problem. « PHP Programming Language « IT news, forums, messages
Re: Alpha/Numeric problem.

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация