鉴于此 stdClass 结构...
[RecentAchievements] => stdClass Object
(
[1446] => stdClass Object
(
[3319] => stdClass Object
(
[ID] => 3319
[GameID] => 1446
[Title] => Hello World!
[Description] => Complete World 1-1
[Points] => 15
[BadgeName] => 03909
[IsAwarded] => 1
[DateAwarded] => 2013-10-20 19:35:46
)
我需要检查 3319 里面的对象,比如“标题”,所以它就像:
$data->RecentAchievements->$gameid->ACHVIDHERE->Title;
要获取 $gameid,它来自其他对象(RecentlyPlayed),这样:
[RecentlyPlayed] => Array
(
[0] => stdClass Object
(
[GameID] => 1446
[ConsoleID] => 7
[ConsoleName] => NES
[Title] => Super Mario Bros
[LastPlayed] => 2013-10-20 21:38:22
[ImageIcon] => /Images/000385.png
[ImageTitle] => /Images/000272.png
[ImageIngame] => /Images/000387.png
[ImageBoxArt] => /Images/000275.png
)
)
$gameid = $data3->RecentlyPlayed['0']->GameID;
API不允许我使用相同的RecentPlayed 来获取成就ID,我必须从RecentAchievements 中提取它。是否可以?