note 48670 deleted from function.is-numeric by felipe
| From: | felipe@php.net | Date: | Thu, 03 Jan 2008 02:04:00 +0000 |
| Subject: | note 48670 deleted from function.is-numeric by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134692@lists.php.net to get a copy of this message | ||
Note Submitter: drew at zitnay dot com
----
What php at thefriedmans dot net said below about .5 returning false and .0.5 returning true
isn't true, at least not for me on PHP 5.0.0. The program:
<?php
echo (is_numeric('5') ? "true" : "false") . "\n";
echo (is_numeric('5.5') ? "true" : "false") . "\n";
echo (is_numeric('.5') ? "true" : "false") . "\n";
echo (is_numeric('.0.5') ? "true" : "false") . "\n";
?>
yields:
true
true
true
false
Just as I would expect.
Drew