By S. / March 24, 2013 / No Comments
$num = 18; if($num&1) { echo 'The number is odd'; } else { echo 'The number is even'; }
And a function:
function is_odd($n){ return (boolean) ($n % 2); }
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.