function is_even($num) { if($number % 2 == 0) { return true; } else { return false; } }
$number = 2; if(is_even($number)) { echo 'it\'s even!'; } else { echo 'it\'s not even!'; }