Skip to content

Instantly share code, notes, and snippets.

@Bebbolus
Last active May 26, 2017 21:29
Show Gist options
  • Save Bebbolus/ff98b93ec5df690abc4b2ae832b28879 to your computer and use it in GitHub Desktop.
Save Bebbolus/ff98b93ec5df690abc4b2ae832b28879 to your computer and use it in GitHub Desktop.
non async PHP program example, Check if number is prime
<?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