SyntaxFix
Write A Post
Hire A Developer
Questions
Another option is a simple bit checking.
n & 1
for example:
if ( $num & 1 ) { //odd } else { //even }