Answers for "check if a number is odd or even with php"

PHP
4

php odd or even

$num = 34;
if ($num % 2 == 0) {
  print "It's even";
}
Posted by: Guest on August-07-2020
1

php check if int is odd

$number = 15;
if ($number % 1 == 0) {
    echo "It's even";
}else{
    echo "oneven";
}
Posted by: Guest on January-17-2021

Code answers related to "check if a number is odd or even with php"

Browse Popular Code Answers by Language