'oda','yukiko'=>'yukiko'); $total = 0; $black_total = 0; $white_total = 0; foreach($b as $val){ $black_total += substr_count($val[0],'b'); $white_total += substr_count($val[0],'w'); } $total = ($black_total + $white_total); if($total%2 === 0){ echo $first_player; }else{ unset($players[$first_player]); echo array_shift($players); } echo "\n"; ?>