任何人都可以请帮助我解决这个问题:我试图用“$someVar->data->values->value
”来回应“值”的值,但不返回任何内容。我也试过$someVar->values->value
。我是一个PHP新手,所以请原谅我,如果这是一个愚蠢的问题。从标准对象中获取价值
stdClass Object ([data] => Array ([0] => stdClass Object ([id] =>
123/insights/post_impressions_organic_unique/lifetime [name] =>
post_impressions_organic_unique [period] => lifetime [values] => Array ([0] =>
stdClass Object ([value] => 286)) [title] => Lifetime Post Organic Reach [description] => Lifetime The number of people who saw your Page post in News Feed or ticker, or on your Page's Wall. (Unique Users))) [paging] => stdClass Object ([previous] =>
https://graph.facebook.com/123/insights/post_impressions_organic_unique&access_token=[next] => https://graph.facebook.com/123/insights/post_impressions_organic_unique&access_token=))
该代码是来自Facebook Graph API的JSON解码输出。
它就像一个魅力!对不起,格式化的代码。再次感谢,你真的帮了我很多! – 2012-03-06 08:30:31