note 111729 deleted from function.is-int by aharvey
| From: | aharvey@php.net | Date: | Thu, 21 Mar 2013 18:38:51 +0000 |
| Subject: | note 111729 deleted from function.is-int by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194164@lists.php.net to get a copy of this message | ||
Note Submitter: info at drupalfever dot com
----
The function that "Derek from storkey.com.uk" suggested was returning TRUE for strings as
well!!
Nothing else was working for me so I decided to create another function.
<?php
function string_is_int($val) {
if ($val == '0') {
return TRUE;
}
$num = (int)$val;
if ($num == 0) {
return FALSE;
}
return TRUE;
}
?>
This one seems to be working fine for me.