Guest User

Untitled

a guest
Jul 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2.  
  3.     $tableau = array(array(0, 0, 0, 0, 0), array(0, 0, 0, 0, 0), array(0, 0, 0, 0, 0) , array(0, 0, 0, 0, 0));
  4.     $cible[30] = array();
  5.    
  6.     for($i=0; $i<30; $i++)
  7.     {
  8.         for($j=0; $j<4; $j++)
  9.         {  
  10.             if(isset($cible[$i]))
  11.                 $cible[$i] = array_merge((array) $cible[$i], (array)array_rand($tableau[$j]));
  12.             else
  13.             {
  14.                 $cible[$i] = array_rand($tableau[$j]);
  15.             }
  16.         }
  17.     }
  18.    
  19.     for($i=0; $i<30; $i++)
  20.     {
  21.         for($j=0; $j<4; $j++)
  22.         {
  23.             echo $cible[$i][$j];
  24.         }
  25.         echo '<br/>';
  26.     }
  27.  
  28. ?>
Add Comment
Please, Sign In to add comment