Guest User

Untitled

a guest
Apr 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. <?php
  2. function is_prime($x) {
  3. if (($x < 2) || ($x % 2 == 0)) {
  4. return false;
  5. }
  6. for ($i = 3; $i <= $x / 2; $i += 2) {
  7. if ($x % i == 0) {
  8. return false;
  9. }
  10. }
  11. return true;
  12. }
  13. ?>
Add Comment
Please, Sign In to add comment