Menu
Put simply, I’m looping through my database results and making an array of winners.
The problem is with my in_array function I want to check if the master array as a nested array with the teamID of my winner or not. See below. Any ideas?
When I check winner against just $arr it adds a new item to for every winner, so a team may show 10 times
$arr = array();while ($row = $result->fetch_assoc()) {
if(in_array($row['Winner'], $arr['teamId'], true)){
} else {
$arr[] = array('teamId' => $row['Winner'], 'Cnt' => 1);
}