note 6925 deleted from function.settype by felipe
| From: | felipe@php.net | Date: | Sat, 29 Dec 2007 18:31:01 +0000 |
| Subject: | note 6925 deleted from function.settype by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134159@lists.php.net to get a copy of this message | ||
Note Submitter: slushpupie at hotmail dot com
----
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>