PHP 数组随机取值,array_rand() 函数 2018-08-16 2488 次阅读 实例返回包含随机键名的数组:$a=array("red","green","blue","yellow","brown");$random_keys=array_rand($a,3);echo $a[$random_keys[0]]."";echo $a[$random_keys[1]]."";echo $a[$random_keys[2]];?>定义...