I have a question. I am trying to filter a match game. In the match game I want to filter the players ...but because there is a home and away team ....I want to seperate them. How is this possible.
my structure
Name Type
Id string
MatchNumber int
Date string
Time string
ClockDirection string
TrueStartTime string
TrueEndTime string
DepartmentId string
DepartmentCode string
DepartmentName string
HomeTeamId string
HomeClubId string
HomeTeam string
AwayTeamId string
AwayClubId string
AwayTeam string
PoolId string
PoolName string
ResultHome int
ResultGuest int
PeriodStandings MatchReportPeriodStandingsItem[]
Actions MatchReportActionsItem[]
Players MatchReportPlayersItem[]
Coaches MatchReportCoachesItem[]
Referees MatchReportRefereesItem[]
Officials MatchReportOfficialsItem[]
for the players info it's like this
MatchReportPlayersItem
Properties
Name Type
Id string
Cap string
Name string
Captain boolean
Team string
If I want to show a list of players It's like this
$Players = [];
foreach($Match->Players as $playerItem) {
$Players[] = $playerItem->Name . ' ' . $playerItem->Team;
}
resulting in
De Craemer H, Van Der Linden H, Baeckelandt H, Christiaens H, Degryse H, Devos H, Dumoulin H, Gevaert H, Gheysen H, Louage H, Mestdag H, Monballieu H, Peremans H, Stieperaere H, Van Den Berghe H, Van Hoestenberghe H, Verschelde H, Verschelde H, Bekar G, Benabdelouahed G, Bochet G, Bourgeois G, Brahim G, Brismee G, Brismee G, Broutard G, Carin G
where the H and G ...stands for Home and Guest ....I want it in two separate list/table ...how am I gonna accomplish this.
So far I got this.
$Players = [];
foreach($Match->Players as $playerItem) {
$Players[] = $playerItem->Name . ' ' . $playerItem->Team;
}
if ($playerItem->Team == "G"){
echo implode(', ', $Players); }
else {
echo " ";
}
can someone help me on this subject thanx!