RE: [PHP] is_numeric for php3

From: Date: Tue, 28 Aug 2001 22:41:21 +0000
Subject: RE: [PHP] is_numeric for php3
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-64908@lists.php.net to get a copy of this message
my understanding is that numeric is a broad term for number values (any value with only numbers and a decimal point) like 1, 5.6, 332, 0.5532, for example. integers are a sub-set of numerics, so any integer is a numeric value, but any numeric value is not necessarily an integer. $num=123 is an integer *and* numeric value. $num='123' might not be an integer, but it is a numeric. now the problem of how to devise a proper test for numeric values (without using regexps) is what i'd like to see. > -----Original Message----- > From: daniel james [mailto:cgi_guy1313@yahoo.com] > Subject: Re: [PHP] is_numeric for php3 > > Hi Philip, > > By definition, any string that does not contain > alpha-characters is numeric. I mean, '123' is an > integer, if only because it isn't 'onetwothree', you > know?

« previous php.general (#64908) next »