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.
私はこれに対する解決策を見つけていません。
3 と 5 の数字があり ます。これらの 2 つの数字のいずれかをランダムに選択するにはどうすればよいですか。
PHPで。 rand() または mt_rand() jsut には、min および max パラメータがあります。
ご協力ありがとうございました!
で乱数を取得し、乱数に応じて新しい値にrand()設定します。$value
rand()
$value
$value = rand(0,1) == 0 ? 3 : 5;