if number is even php code example
Example 1: How to check even or odd number in php
$num = 85;
if($num % 2 == 0){
echo "this is even number";
}else{
echo "this is odd number";
}
Example 2: php odd or even
$num = 34;
if ($num % 2 == 0) {
print "It's even";
}
Example 3: php check if int is odd
$number = 15;
if ($number % 1 == 0) {
echo "It's even";
}else{
echo "oneven";
}