简单教程
提交运行
代码编辑器:
<?php $a=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow"); print_r(array_rand($a,2));
运行结果: