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

Posted by Curt Zirzow on 11/17/05 21:51

On Thu, Nov 17, 2005 at 02:37:49PM -0500, blackwater dev wrote:
> 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....

http://php.net/ctype_digit

Curt.
--

 

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

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