Share your knowledge with other learners . . . Login Register

Check even odd in PHP

📔 : PHP 🔗
Copy Fullscreen Close Fullscreen
  function check_even_odd($number)
    if($number%2 == 0)
      echo "$number is an even number.";
      echo "$number is an odd number.";

  /*now test*/
22 is an even number.
21 is an odd number.

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.

Get connected with me. :) LinkedIn Twitter Instagram Facebook