![](http://www.studyzone4u.com/assets/image/ads6.jpg)
How can you tell if a number is even or odd without using any condition or loop?
Last updated 5 years, 3 months ago | 3206 views 75 5
![](/media/uploads/2020/11/28/sz4u-cover-php.jpg)
PHP | check whether a number is even or odd
A trick to check whether a number is even or odd without using any condition or loop.
<?php
$arr=array("0"=>"Even","1"=>"Odd");
$check=13;
echo "Your number is: ".$arr[$check%2];
?>