Last active
May 26, 2017 21:29
-
-
Save Bebbolus/ff98b93ec5df690abc4b2ae832b28879 to your computer and use it in GitHub Desktop.
non async PHP program example, Check if number is prime
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 | |
function isPrime($numberToCheck) { | |
for($n = $numberToCheck- 1; $n > 1; $n--) { | |
if (!($numberToCheck% $n)) { | |
return false; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment