note 27632 deleted from function.is-int by cece
| From: | cece@php.net | Date: | Mon, 18 Aug 2003 20:59:02 +0000 |
| Subject: | note 27632 deleted from function.is-int by cece | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54615@lists.php.net to get a copy of this message | ||
Note Submitter: phpnet.zu.askwar@spamgourmet.com
----
The last example also didn't quite work as I expected, because strcmp() returns 0 if the
strings are equal. However, 0 == false.
Now, here's my take:
function str_is_int($str) {
return 0 === strcmp($str , (int)$str);
}
This will return a bool.