note 74966 added to function.ctype-digit
| From: | shivanfalcon at gmail dot com | Date: | Sun, 06 May 2007 22:09:42 +0000 |
| Subject: | note 74966 added to function.ctype-digit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126265@lists.php.net to get a copy of this message | ||
This function also seems to give a false for integers (PHP 4.4.4)
<?php
$var = 5;
if (cytype_digit($var))
{
echo "This does not consist of only digits.";
}
else
{
echo "This cosists of only digits.";
}
?>
Returns "This does not consist of only digits.".
I can only assume that this is because of how integers are seen.
2 = 00000010 bitwise
bitwise, 00000010 happens to be some ASCII formatting character, which isn't a digit.
----
Server IP: 69.39.81.135
Probable Submitter: 68.183.64.98
----
Manual Page -- http://www.php.net/manual/en/function.ctype-digit.php
Edit -- https://master.php.net/note/edit/74966
Del: integrated -- https://master.php.net/note/delete/74966/integrated
Del: useless -- https://master.php.net/note/delete/74966/useless
Del: bad code -- https://master.php.net/note/delete/74966/bad+code
Del: spam -- https://master.php.net/note/delete/74966/spam
Del: non-english -- https://master.php.net/note/delete/74966/non-english
Del: in docs -- https://master.php.net/note/delete/74966/in+docs
Del: other reasons-- https://master.php.net/note/delete/74966
Reject -- https://master.php.net/note/reject/74966
Search -- https://master.php.net/manage/user-notes.php