The shuffle () function sorts the elements in the array in random order.
If yes, TRUE is returned. Otherwise, FALSE is returned.
Note: This function assigns a new key name to the cell in the array. This will delete the original key name, not just the reorder.
Note: Since PHP 4.2.0, the random number generator is no longer needed to be planted using the srand () or mt_srand () function, which has been automatically completed.
<? Php tutorial
$ My_array = array ("a" => "Dog", "B" => "Cat", "c" => "Horse ");
Shuffle ($ my_array );
Print_r ($ my_array );
?>
The following is a // list of ADS stored in arrays.
$ Ads = array (<a href = "#"> </ a>
, <A href = "#"> </a>
, <A href = "#"> </a>
, <A href = "#"> </a>
);
// Random sorting of Arrays
Shuffle ($ ads );
// Output the sorted Array
$ Html =;
Foreach ($ ads as $ ad ){
$ Html. = $ ad;
}
Echo $ html;