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)];
これは、数値から変数の値になります