运行 ❯
获取您
自己的 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>
数组 ( [0] => 黄色 [1] => 紫色 [2] => 红色 [3] => 蓝色 [4] => 绿色 )
刷新页面,查看 shuffle() 如何随机化数组中元素的顺序。