任何人都可以請幫助我解決這個問題:我試圖用「$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