Studyon Minte9.com
ZCE 5.3




Randomize



shuffle()

<?php $cards = array (1, 2, 3, 4); shuffle ($cards); var_dump ($cards); // random cards
  array_rand() - extract at random
<?php $cards = array (1, 2, 3, 4); $keys = array_rand($cards, 2); print_r($keys); // Array ( [0] => 3 [1] => 1 ) randomly