我得到了这个问题。我试图从一个对象中获取数组中的某些对象。如何问一个对象内的某个对象内的某个对象
我做了这个功能,我要求单个匹配显示。
function match() {
$Match = WaterpoloAPI::call("Matches", "getMatch", Array($_GET["MatchId"]));
echo "<td>$Match->Date</td> <td>$Match->Time</td> <td>$Match->PoolName</td><td class='text-center'>$Match->HomeTeam </td><td><strong><a href='wedstrijd?MatchId=".$Match->Id."'>$Match->ResultHome - $Match->ResultGuest </a></strong></td><td> $Match->AwayTeam</td>";
}
我可以选择那场比赛表现出的项目清单...
MatchItem
Properties
Name Type
Id string
MatchNumber int
Date string
Time string
DepartmentId string
DepartmentCode string
DepartmentName string
HomeTeamId string
HomeTeam string
AwayTeamId string
AwayTeam string
PoolId string
PoolName string
PoolCity string
MatchReport string
Played boolean
ResultHome int
ResultGuest int
**Referees MatchRefereeItem[]**
,但我想告诉裁判...但它是一个数组...我该怎么办去做?
**MatchRefereeItem
Properties**
Name Type
Id string
Initials string
FirstName string
Insertion string
LastName string
Sex string
Indication int
我还在学习,也许这是一个愚蠢的问题,所以我很抱歉。但如果有人能帮助我,那将会很棒。
尝试https://stackoverflow.com/questions/ 4414623/loop-through-an-array -php –
u_mulder thx为你的答案,但它仍然无法正常工作......我试过这个foreach($ Referees as $ Referee){ \t echo“$ Referee-> FirstName”; \t} –