📜  php 从数组中获取随机元素 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:43.887000             🧑  作者: Mango

代码示例5
$array = ["a", "b", "c"];
$random = $array[ Rand(0, count($array)-1) ];

echo $random; // a or b or c