You are here: Re: checkng if string is a number « PHP « IT news, forums, messages
Re: checkng if string is a number

Posted by Ben on 11/17/05 21:42

blackwater dev said the following on 11/17/2005 11:37 AM:
> How can I check to see if a string var holds a number? Is regex the
> only way to do this? For example I have code where the var could hold
> "10" or "ten". If the string is a number, do one thing, if it isn't
> do something else. is_int doesn't work, intval converts "ten" to a
> number so that doesn't work....

is_numeric

http://ca.php.net/is_numeric

- Ben

 

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

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