Treat JSON API query Facebook

2

I'm making requests for a user's posts to the Facebook API as in the code below.

//faz requisição
$postagens = file("https://graph.facebook.com/".$url."/posts?access_token=".$token);
//imprime as postagens
echo $postagens[0];

And I'm having a return in JSON format, I need to separate the posts to group the way I want, I'm trying to use the explode () function, but I'm not succeeding. any advice?

    
asked by anonymous 12.08.2015 / 14:59

1 answer

2

Use the json_decode($var) function.

When you receive the data just make a foreach to print them.

See a question related to his and Sergio's fourth answer.

link

    
12.08.2015 / 15:05