note 74966 deleted from function.ctype-digit by philip

From: Date: Sun, 22 Feb 2009 21:13:41 +0000
Subject: note 74966 deleted from function.ctype-digit by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-150963@lists.php.net to get a copy of this message
Note Submitter: shivanfalcon at gmail dot com ---- 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.

« previous php.notes (#150963) next »