Created
December 1, 2020 13:41
-
-
Save FreshLondon/b2f11855d6049998997a21c6b52f3ffe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Check whether a number is odd or even. | |
if (!function_exists('checkOddEven')) { | |
function checkOddEven($number){ | |
if($number % 2 == 0){ | |
echo "Even"; | |
} | |
else{ | |
echo "Odd"; | |
} | |
} | |
} | |
// to output | |
$value = 12; | |
checkOddEven($value); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment