At 03:41 PM 8/28/01 , scott [gts] wrote:
>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.
function is_numeric($Something) { return (string)(1.0*$Something) ==
$Something; }
should work.
-steve
+------------------------------------------------------------------------+
| Steve Edberg University of California, Davis |
| [EMAIL PROTECTED] (530)754-9127 |
| http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ |
+---------------------- Gort, Klaatu barada nikto! ----------------------+