note 47642 deleted from function.settype by nlopess
| From: | nlopess@php.net | Date: | Tue, 23 Nov 2004 22:14:15 +0000 |
| Subject: | note 47642 deleted from function.settype by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-80942@lists.php.net to get a copy of this message | ||
Note Submitter:
----
in PHP3 converting a string to any number results in the value becoming 0. To check if a string
represents a number try this:
<PRE>
$test = "0001";
$testcp = $test;
settype($testcp,"double");
if (strval($testcp) === $test) {
echo("\$test is a number");
} else {
echo ("\$test is not a number");
}
</PRE>