php - How to echo user post like of Facebook using API -
hy today trying fetch user status i'd using facebook api through access token , success when try fetch likes on post doesn't echo data ... don't know mistake here code
<? require 'token.php'; require 'uid.php'; $feed=json_decode(file_get_contents('https://graph.fb.me/'.$uid.'/feed?access_token='.$token.'&limit=1'),true); $idstt = $feed['data'][0]['id']; $stt = explode("_", $idstt); $idstt= $stt[1]; $sllike = $feed['data']['0']['likes']['count']; echo $sllike; echo $idstt; ?>
here output status i'd see screenshot
this post i'd how echo likes of post thanks in advance
i dont understand question clearly, guess that:
$a=1; $b=2; $newarr = compact("a","b");
if use
print_r($newarr);
result
array ( [a] => 1 [b] => 2 )
if use
echo json_encode($newarr);
result
{"a":1,"b":2}
Comments
Post a Comment