Treat JSON for Facebook API query

Asked

Viewed 207 times

2

I’m making requests for a user’s posts to 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 desired way, I’m trying to use the function explode(), but I’m not succeeding. some advice?

1 answer

2


Use the function json_decode($var).

When receiving the data just make a foreach to print them out.

See a question related to your and Sérgio’s fourth answer.

/a/4413/23919

Browser other questions tagged

You are not signed in. Login or sign up in order to post.