FQL: Facebook php application

Hello, I applied the following

$fql = "SELECT uid2 FROM friend WHERE uid1=" . $uid; $param = array( 'method' => 'fql.query', 'query' => $fql, 'callback' => '' ); $fqlResult = $facebook->api($param); 

Now I need to get the elements from $fqlResult . How can I do it?

+4
source share
2 answers

You can just iterate over the array returned by facebook:

 $fqlResult = $this->facebook->api($param); foreach($fqlResult as $result) { print_r($result); print($result['name']); } 

Thanks for the code! I was looking for this way to create FQL with a new library!

+5
source

You can also print the entire array in a convenient format (due to presets) with the following function:

 function d($array) { echo '<pre>'; print_r($array); echo '</pre>'; } d($fqlResult); 
0
source

Source: https://habr.com/ru/post/1309871/


All Articles