Phpshuffle () random sorting code for arrays. 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 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;
The http://www.bkjia.com/PHPjc/478762.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478762.htmlTechArticleshuffle () function rearranged 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...