Created
March 30, 2011 15:53
-
-
Save joshuabaker/894658 to your computer and use it in GitHub Desktop.
Detect if a number is odd or even.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$number = 10; | |
echo ($number & 1) ? "odd" : "even"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment