下面是我的一些代碼部分:檢查多個字符串的spesific數
<?php
$terning1 = rand(1,6);
$terning2 = rand(1,6);
$terning3 = rand(1,6);
$terning4 = rand(1,6);
$terning5 = rand(1,6);
$terning6 = rand(1,6);
//Here i need a system to check how many of them that gets number 6
?>
洙我需要的是方法來檢查多少$ terning1-6返回數量6可以說$ terning1和$ terning4然後我需要一種方式告訴我,他們中的2人是6.我不知道我怎麼能做到這一點,因爲我從來沒有做過這樣的事情。
很抱歉,但我不知道如何保存所有那些在一個數組中,並且客棧這個代碼我怎麼得到有多少個6是?像$ howmany = SOMETHING; //應該給我的數量是6 –