Re: checkng if string is a number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux