Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. set_time_limit(60);
  4.  
  5. $stime = time();
  6. $i = 20;
  7. $completion = false;
  8.  
  9. while(!$completion) {
  10.     $checkarray = array(3,6,7,8,9,11,12,13,14,15,16,17,18,19);
  11.     $fail = false;
  12.     foreach($checkarray as $value) {
  13.         if(!($i % $value == 0)) {
  14.             $fail = true;
  15.         }
  16.     }
  17.     if($fail) {
  18.         $i = $i + 20;
  19.     } else {
  20.         $completion = true;
  21.     }
  22. }
  23.  
  24. $etime = time();
  25.  
  26. echo $i . " in " . ($etime - $stime) . " seconds";
  27.    
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement