<?php
/*
* Description:This function returns true if passed number is divisible by two, false if not
*/
function isEven($number){
$isEven = false;
if(is_numeric ($number)){
if($number%2 == 0)
$isEven = true;
}
return $isEven;
}
?>
November 18, 2016
How to check if a number is ODD or Even in PHP?
Related Posts:
Use Multiple Version of PHP on Ubuntu USE MULTIPLE PHP VERSIONS ON LINUX While working on different projects on the same machine and not using any package manager in PHP can put you on… Read More
How to check if a number is ODD or Even in PHP? <?php/* * Description:This function returns true if passed number is divisible by two, false if not*/function isEven($number){ … Read More
Laravel - env file not working - solution Laravel - env file not working - solution I was playing around the Laravel which is a nice framework for PHP developers. It has awesome features.… Read More
Laravel - Run Controller in Terminal How to run a controller function via command line or terminal in Laravel? Well, there are several ways to do it. Like making a command shell wh… Read More
PHP - Clean code Tips Writing clean code with security and easy to maintain in PHP This quote says it all for the coders. Code written should be easy to understand, &… Read More