Re: checkng if string is a number

From: Date: Thu, 17 Nov 2005 19:51:18 +0000
Subject: Re: checkng if string is a number
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-226003@lists.php.net to get a copy of this message
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. --

« previous php.general (#226003) next »