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: srand () or mt_srandSyntaxHighlighter is no longer required since PHP4.2.0.
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.
$ 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 (
,
,
,
);
// Random sorting of arrays
Shuffle ($ ads );
// Output the sorted array
$ Html =;
Foreach ($ ads as $ ad ){
$ Html. = $ ad;
}
Echo $ html;