我试图从两个单独的数组中匹配三个或更多数字,但到目前为止我所拥有的只是匹配前三个数字的代码,当我需要它来比较所有六个数字并查看是否有三个共同点时?我试过比较所有六个数字,但它不起作用。任何帮助表示赞赏。杰西卡
foreach($lottoTickets as $y => $yvalue)
{
if($i == 0)
{
echo " ";
}
else{
if((($winner[0] == $lottoTickets[$y][0]) || ($winner[0] == $lottoTickets[$y][1]) || ($winner[0] == $lottoTickets[$y][2]) || ($winner[0] == $lottoTickets[$y][3]) || ($winner[0] == $lottoTickets[$y][4]) || ($winner[0] == $lottoTickets[$y][5])) &&
(($winner[1] == $lottoTickets[$y][0]) || ($winner[1] == $lottoTickets[$y][1]) || ($winner[1] == $lottoTickets[$y][2]) || ($winner[1] == $lottoTickets[$y][3]) ||($winner[1] == $lottoTickets[$y][4]) || ($winner[1] == $lottoTickets[$y][5])) &&
(($winner[2] == $lottoTickets[$y][0]) || ($winner[2] == $lottoTickets[$y][1]) || ($winner[2] == $lottoTickets[$y][2]) || ($winner[0] == $lottoTickets[$y][3]) ||($winner[2] == $lottoTickets[$y][4]) || ($winner[2] == $lottoTickets[$y][5])))
echo "<b>Three winning numbers ID = </b>" .$y;
}