【发布时间】:2017-12-19 08:36:58
【问题描述】:
我遇到了这个问题。我正在尝试从对象中获取数组中的某些对象。
我创建了这个功能,要求显示单个匹配项。
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
我还在学习,也许这是一个愚蠢的问题,所以我很抱歉。但如果有人能帮助我,那就太好了。
【问题讨论】:
-
u_mulder 感谢您的回答,但它仍然无法正常工作......我试过这个 foreach($Referees as $Referee) { echo "$Referee->FirstName"; }