note 109443 added to function.is-int
| From: | petepostma at gmail dot spam dot com | Date: | Tue, 17 Jul 2012 18:38:42 +0000 |
| Subject: | note 109443 added to function.is-int | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189271@lists.php.net to get a copy of this message | ||
There is a versa to the vice of this int only type check.
is_int( $integer_type) will only return true, if the TYPE is int, not the value
ctype_digit( $string_type) will only return true if the TYPE is string, and its value is INT
therefore:
return ( is_int($value) || ctype_digit($value) );
----
Server IP: 46.22.129.76
Probable Submitter: 216.82.251.232
----
Manual Page -- http://www.php.net/manual/en/function.is-int.php
Edit -- https://master.php.net/note/edit/109443
Del: integrated -- https://master.php.net/note/delete/109443/integrated
Del: useless -- https://master.php.net/note/delete/109443/useless
Del: bad code -- https://master.php.net/note/delete/109443/bad+code
Del: spam -- https://master.php.net/note/delete/109443/spam
Del: non-english -- https://master.php.net/note/delete/109443/non-english
Del: in docs -- https://master.php.net/note/delete/109443/in+docs
Del: other reasons-- https://master.php.net/note/delete/109443
Reject -- https://master.php.net/note/reject/109443
Search -- https://master.php.net/manage/user-notes.php