Advertisement
Guest User

Untitled

a guest
Jan 12th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1.  
  2. <?php
  3.   $items = ["where","is","my","money"];
  4.   for ($summ = 1; $summ <= 100; ++$summ){
  5.     if($summ % 3 ===0 && $summ % 5 ===0){
  6.         shuffle($items);
  7.        
  8.     }
  9.     if($summ % 3 ===0){
  10.         $rand_items = rand(0, count($items) - 1);
  11.         echo "$items[$rand_items]\r\n";
  12.      
  13.     }
  14.     elseif($summ % 5 === 0 ){
  15.         $summ+=5;
  16.        
  17.     }
  18.     elseif($summ % 3 ===0 && $summ % 5 ===0){
  19.         shuffle($items);
  20.         echo $summ;
  21.        
  22.     }    
  23.   }
  24.   print_r($items);
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement