2022-03-19 1016
<!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>
shuffle() 函数把数组中的元素按随机顺序重新排列。
该函数为数组中的元素分配新的键名,已存在的键名将被删除(参见下面的实例 1)。
<!DOCTYPE html> <html> <body> <?php $my_array = array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow","e"=>"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>
原文链接:https://77isp.com/post/767.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态