home_id == $team_id) $count++; break; case 'away': if ($value->away_id == $team_id) $count++; break; default: $count++; break; } } return $count; } }