运行 ❯
获取您的
自己的 PHP
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <?php $my_array = array("red","green","blue","yellow","purple"); shuffle($my_array); print_r($my_array); ?> <p>Refresh the page to see how shuffle() randomizes the order of the elements in the array.</p> </body> </html>
Array ( [0] => yellow [1] => purple [2] => red [3] => blue [4] => green )
刷新页面以查看 shuffle() 如何随机化数组中元素的顺序。