Skip to content

Instantly share code, notes, and snippets.

@FreshLondon
Created December 1, 2020 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FreshLondon/b2f11855d6049998997a21c6b52f3ffe to your computer and use it in GitHub Desktop.
Save FreshLondon/b2f11855d6049998997a21c6b52f3ffe to your computer and use it in GitHub Desktop.
<?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