note 79550 deleted from function.is-numeric by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 16:02:13 +0000 |
| Subject: | note 79550 deleted from function.is-numeric by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133593@lists.php.net to get a copy of this message | ||
Note Submitter: Dougie
----
In regards to Carlos Madeira:
"If I may, i think there is a simpler way to determine if a number is odd or even:
if( $number & 1 ) //Just check the last bit!
echo 'It's odd!';
else
echo 'It's even!';"
To check for even:
if( $number & 2 ) //Just check the last bit!
echo 'It's even!';
else
echo 'It's odd!';"