Jump to content

PHP Json Array


Danny620

Recommended Posts

I have a json file returned by facebook e.g

 

{

  "data": [

      {

        "name": "Support! Muffin the fool (Oldham Chronicle FAKE)",

        "category": "Community",

        "id": "181377645219010",

        "access_token": "102650199811234|060d3610d4dba63953209fa5-637782927|181377645219010|MvOBJKYtO7eT8JxMLtJ00HtGNxo"

      },

      {

        "name": "Northplanet",

        "category": "Local business",

        "id": "132483460132622",

        "access_token": "102650199811234|060d3610d4dba63953209fa5-637782927|132483460132622|AHXPNTZx7aihyQS_A9W6pR115U4"

      },

      {

        "name": "Social Media Manger",

        "category": "Application",

        "id": "102650199811234",

        "access_token": "102650199811234|060d3610d4dba63953209fa5-637782927|102650199811234|KeH0n1OKzZFtCkpa0lX1yJZ7NBE"

      },

      {

        "name": "Top Ten Things To Remember Me By!",

        "category": "Application",

        "id": "375102030458",

        "access_token": "102650199811234|060d3610d4dba63953209fa5-637782927|375102030458|H-mpQWrksu_2FzZ_eBNVzeD2Z1Y"

      }

  ]

}

 

$graph_url = "https://graph.facebook.com/$uid/comments=" . $access_token;

    $api = json_decode(file_get_contents($graph_url));

 

$name = $api->data->name; // this bit not storing the name not sure why

Link to comment
https://forums.phpfreaks.com/topic/225681-php-json-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.