php - json api graph call does not return anything? -
i fetching users fb newfeed , wanted check wether user has liked post or not using user_likes , problem following code wont return :
$getlike = $facebook->api("/fql?q=select like_info stream post_id=" . $id); $checklike = $getlike['data'][0]['like_info']['user_likes'];
here complete file: testone.php problem fql , calling user_likes wont return anything. want check wether user has liked post or how can value user_likes.
json fb :
{ "data": [ { "like_info": { "can_like": true, "like_count": 70, "user_likes": false } } ] }
is technique right?do need access code or something?
if getting value of $getlike
, can check value of user_likes
(since of type boolean)-
if($getlike['data'][0]['like_info']['user_likes']) { echo "true"; } else { echo "false"; }
Comments
Post a Comment