The shuffle () function rearranges the elements in the array in random order.
Returns TRUE if successful, otherwise FALSE is returned.
Note: This function assigns the new key name to the cells in the array. This will delete the original key name and not just reorder it.
Note: Since PHP 4.2.0, it is no longer necessary to sow the random number generator with the Srand () or Mt_srand () function, which is now automatically completed
$my _array = Array ("A" = "Dog", "b" = "Cat", "c" = "Horse");
Shuffle ($my _array);
Print_r ($my _array);
?>
Here's A//use an array to store your ad list
$ads = Array (
,
,
,
);
Random Sorting of arrays
Shuffle ($ads);
Output a sorted array
$html =;
foreach ($ads as $ad) {
$html. = $ad;
}
Echo $html;
http://www.bkjia.com/PHPjc/478762.html www.bkjia.com true http://www.bkjia.com/PHPjc/478762.html techarticle The Shuffle () function rearranges the elements in the array in random order. Returns TRUE if successful, otherwise FALSE is returned. Note: This function assigns the new key name to the cells in the array. This ...