http://graph.facebook.com/?id=http://givingmode.com/
給了我這個數據
{
"id": "http://givingmode.com/",
"shares": 3
}
現在,我使用這個腳本來獲取ID,股價在PHP變量
$File= file_get_contents('http://graph.facebook.com/?id=http://givingmode.com/');
$p=json_decode($File);
foreach ($p as $loc)
{
$fb_tot_share=$loc->shares;
}
但我不知道我在做什麼錯;
我得到$fb_tot_share
爲空白。
請幫我解決這個問題。