Reply to Alpha/Numeric problem.

Your name:

Reply:


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

[Back to original 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

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