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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -