Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$first = "Text 1" $second = "Text 2" $third = "Text 3" $fourth = "Text 4" $fifth = "Text 5"
我想创建一个函数,它显示 $second 和 $fourth 的频率是其他变量的 3 倍。
这个怎么做?
$arr = array($first, $second, $second, $second, $third, $fourth, $fourth, $fourth, $fifth); $elem = $arr[array_rand($arr)];
这将从数字变为变量的值