Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5850313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:07:23+00:00 2026-05-22T13:07:23+00:00

I have this json content inside a var in php: { data: [ {

  • 0

I have this json content inside a var in php:

{
   "data": [
      {
         "id": "1977103383661",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "MUM Invasion Photos",
         "link": "http://www.facebook.com/album.php?aid=2117387&id=1125405534",
         "cover_photo": "1977103423662",
         "privacy": "friends",
         "count": 1,
         "type": "normal",
         "created_time": "2011-05-06T12:21:30+0000",
         "updated_time": "2011-05-06T12:21:30+0000"
      },
      {
         "id": "1954051927389",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Milan",
         "location": "Milan",
         "link": "http://www.facebook.com/album.php?aid=2115307&id=1125405534",
         "cover_photo": "1954052447402",
         "privacy": "friends",
         "count": 26,
         "type": "normal",
         "created_time": "2011-04-25T11:58:14+0000",
         "updated_time": "2011-05-07T17:18:10+0000"
      },
      {
         "id": "1875623126718",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Wall Photos",
         "link": "http://www.facebook.com/album.php?aid=2108888&id=1125405534",
         "cover_photo": "1875623166719",
         "privacy": "everyone",
         "count": 1,
         "type": "wall",
         "created_time": "2011-03-28T02:43:54+0000",
         "updated_time": "2011-03-28T02:43:54+0000"
      },
      {
         "id": "1832680213172",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "PhotoAge for iPhone\u00ae",
         "description": "\"PhotoAge for iPhone\u00ae\" por Percipo Inc. Haciendo computadoras mas humano...",
         "link": "http://www.facebook.com/album.php?aid=2106226&id=1125405534",
         "cover_photo": "1832680293174",
         "privacy": "friends",
         "count": 3,
         "type": "normal",
         "created_time": "2011-03-05T18:18:09+0000",
         "updated_time": "2011-03-05T18:20:52+0000"
      },
      {
         "id": "1718288673455",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Camera+ Photos",
         "link": "http://www.facebook.com/album.php?aid=2097024&id=1125405534",
         "cover_photo": "1718288753457",
         "privacy": "friends",
         "count": 2,
         "type": "normal",
         "created_time": "2010-12-26T22:38:52+0000",
         "updated_time": "2010-12-26T22:39:14+0000"
      },
      {
         "id": "1716820796759",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Galaxy Tab Contest",
         "link": "http://www.facebook.com/album.php?aid=2096857&id=1125405534",
         "cover_photo": "1716827796934",
         "privacy": "custom",
         "count": 5,
         "type": "normal",
         "created_time": "2010-12-26T00:50:27+0000",
         "updated_time": "2011-01-31T19:46:19+0000"
      },
      {
         "id": "1688275683149",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Pasantias de la beca",
         "location": "Palermo-Italia",
         "link": "http://www.facebook.com/album.php?aid=2094132&id=1125405534",
         "cover_photo": "1688275843153",
         "privacy": "friends",
         "count": 45,
         "type": "normal",
         "created_time": "2010-12-06T18:27:02+0000",
         "updated_time": "2011-03-26T18:56:36+0000"
      },
      {
         "id": "1595209916563",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Profile Pictures",
         "link": "http://www.facebook.com/album.php?aid=2082673&id=1125405534",
         "cover_photo": "1579272118128",
         "privacy": "friends",
         "count": 3,
         "type": "profile",
         "created_time": "2010-10-07T16:12:55+0000",
         "updated_time": "2011-04-10T04:17:28+0000"
      },
      {
         "id": "1219601286582",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Mobile Uploads",
         "link": "http://www.facebook.com/album.php?aid=2036068&id=1125405534",
         "cover_photo": "1219601326583",
         "privacy": "custom",
         "count": 46,
         "type": "mobile",
         "created_time": "2009-09-13T01:38:31+0000",
         "updated_time": "2011-04-10T04:18:10+0000"
      },
      {
         "id": "1167780671099",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Nueva vieja tabla",
         "location": "Playa hedionda",
         "link": "http://www.facebook.com/album.php?aid=2027360&id=1125405534",
         "cover_photo": "1167782391142",
         "privacy": "custom",
         "count": 12,
         "type": "normal",
         "created_time": "2009-06-21T01:37:13+0000",
         "updated_time": "2011-04-10T04:19:13+0000"
      },
      {
         "id": "1104082278679",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Cuya",
         "description": "RLST & SRT",
         "location": "Cuyagua",
         "link": "http://www.facebook.com/album.php?aid=2018540&id=1125405534",
         "cover_photo": "1104091558911",
         "privacy": "custom",
         "count": 30,
         "type": "normal",
         "created_time": "2009-03-01T23:49:23+0000",
         "updated_time": "2011-04-10T04:16:34+0000"
      },
      {
         "id": "1057859363135",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Boca de Aroa",
         "link": "http://www.facebook.com/album.php?aid=2010172&id=1125405534",
         "cover_photo": "1057880363660",
         "privacy": "custom",
         "count": 10,
         "type": "normal",
         "created_time": "2008-11-05T01:16:46+0000",
         "updated_time": "2011-04-10T04:16:25+0000"
      },
      {
         "id": "1051327359839",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "2da mojada",
         "location": "Playa fantasma, via tucacas",
         "link": "http://www.facebook.com/album.php?aid=2008928&id=1125405534",
         "cover_photo": "1051329159884",
         "privacy": "custom",
         "count": 11,
         "type": "normal",
         "created_time": "2008-10-15T00:58:48+0000",
         "updated_time": "2011-04-10T04:16:15+0000"
      },
      {
         "id": "1050703064232",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Estrenando tabla",
         "location": "Patanemo",
         "link": "http://www.facebook.com/album.php?aid=2008822&id=1125405534",
         "cover_photo": "1050705184285",
         "privacy": "custom",
         "count": 13,
         "type": "normal",
         "created_time": "2008-10-12T22:29:46+0000",
         "updated_time": "2011-04-10T04:19:22+0000"
      },
      {
         "id": "1037750900436",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Surfing Safari",
         "location": "Choroni",
         "link": "http://www.facebook.com/album.php?aid=2006692&id=1125405534",
         "cover_photo": "1037753740507",
         "privacy": "custom",
         "count": 48,
         "type": "normal",
         "created_time": "2008-08-24T23:28:22+0000",
         "updated_time": "2011-05-08T23:56:24+0000"
      },
      {
         "id": "1032278323625",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "El Acto",
         "location": "Valencia",
         "link": "http://www.facebook.com/album.php?aid=2006001&id=1125405534",
         "cover_photo": "1037921944712",
         "privacy": "custom",
         "count": 23,
         "type": "normal",
         "created_time": "2008-08-06T02:43:55+0000",
         "updated_time": "2011-05-09T00:03:05+0000"
      },
      {
         "id": "1031740150171",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "LA Marcha",
         "location": "UC",
         "link": "http://www.facebook.com/album.php?aid=2005922&id=1125405534",
         "cover_photo": "1031754630533",
         "privacy": "custom",
         "count": 33,
         "type": "normal",
         "created_time": "2008-08-04T03:00:19+0000",
         "updated_time": "2011-05-07T18:04:21+0000"
      },
      {
         "id": "1029393851515",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Defensa de la Tesis",
         "description": "20pts!!!",
         "location": "Valencia",
         "link": "http://www.facebook.com/album.php?aid=2005543&id=1125405534",
         "cover_photo": "1029395531557",
         "privacy": "custom",
         "count": 27,
         "type": "normal",
         "created_time": "2008-07-26T02:27:55+0000",
         "updated_time": "2011-05-07T09:03:28+0000"
      },
      {
         "id": "1021161285706",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Rumbas, Playa y demas",
         "link": "http://www.facebook.com/album.php?aid=2004373&id=1125405534",
         "cover_photo": "1021163805769",
         "privacy": "custom",
         "count": 52,
         "type": "normal",
         "created_time": "2008-06-17T00:35:03+0000",
         "updated_time": "2011-04-12T03:16:11+0000"
      },
      {
         "id": "1013076403589",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Solo en Venezuela",
         "link": "http://www.facebook.com/album.php?aid=2003189&id=1125405534",
         "cover_photo": "1013077843625",
         "privacy": "custom",
         "count": 60,
         "type": "normal",
         "created_time": "2008-05-03T16:58:49+0000",
         "updated_time": "2011-04-10T04:14:03+0000"
      },
      {
         "id": "1010917109608",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Algunas Varias",
         "link": "http://www.facebook.com/album.php?aid=2002900&id=1125405534",
         "cover_photo": "1010917909628",
         "privacy": "custom",
         "count": 17,
         "type": "normal",
         "created_time": "2008-04-21T05:53:03+0000",
         "updated_time": "2011-04-10T04:15:01+0000"
      },
      {
         "id": "1008495809077",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "Solo para el video",
         "description": "Este albun solo es para el video...",
         "link": "http://www.facebook.com/album.php?aid=2002571&id=1125405534",
         "cover_photo": "1008495969081",
         "privacy": "custom",
         "count": 15,
         "type": "normal",
         "created_time": "2008-04-06T05:32:57+0000",
         "updated_time": "2011-04-06T21:32:12+0000"
      },
      {
         "id": "1008464688299",
         "from": {
            "name": "Domingo Sarmiento Lupo",
            "id": "1125405534"
         },
         "name": "PhotoShop",
         "description": "Algunos trabajos de PhotoShop. Sugerencias?",
         "link": "http://www.facebook.com/album.php?aid=2002568&id=1125405534",
         "cover_photo": "1041428912384",
         "privacy": "custom",
         "count": 42,
         "type": "normal",
         "created_time": "2008-04-05T23:00:03+0000",
         "updated_time": "2011-05-09T21:08:06+0000"
      }
   ],
   "paging": {
      "previous": "https://graph.facebook.com/me/albums?access_token=2227470867|2.AQCF2qmOAjCq-I1Y.3600.1305979200.0-1125405534|4Fni91SEYdaFvpF5AscYzuVBwEg&limit=25&since=1304684490",
      "next": "https://graph.facebook.com/me/albums?access_token=2227470867|2.AQCF2qmOAjCq-I1Y.3600.1305979200.0-1125405534|4Fni91SEYdaFvpF5AscYzuVBwEg&limit=25&until=1207436403"
   }
}

I want to echo every ID and NAME from each block, but Im very new at json and i always get stuck when i need to read more than one data. Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T13:07:24+00:00Added an answer on May 22, 2026 at 1:07 pm

    Assumed your shown JSON object is assigned as that to a JS variable o and you want to loop in JS:

    for (i = 0; i < o.data.length; i++) {
        alert(
            'id = ' + o.data[i].id + '\n' +
            'name = ' +  o.data[i].name  + '\n' +
            'from.id = ' + o.data[i].from.id + '\n' +
            'from.name = ' +  o.data[i].from.name
        );
    }
    

    Assumed your shown JSON object is assigned as that in a PHP string variable $s:

    $aObject = json_decode($s, true);
    foreach ($aObject['data'] as $i => $a) {
        echo
            'id = ' . $a['id'] . "<br />\n" .
            'name = ' . $a['name'] . "<br />\n" .
            'from.id = ' . $a['from']['id'] . "<br />\n" .
            'from.name = ' . $a['from']['name'] . "<br /><br />\n\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web service that queries data from this json file, but I
I have a query on retrieving data sent as JSON from a JavaScript, inside
I have the following PHP that creates some JSON from a MySQL query. This
I am creating a json array in PHP like this (it's inside a class):
I have this PHP code echo '<a href=# onclick=updateByQuery(\'Layer3\', ' . json_encode($query) . ');>Link
I have this little function function makewindows(){ child1 = window.open (about:blank); child1.document.write(<?php echo htmlspecialchars(json_encode($row2['ARTICLE_DESC']),
I have this json but I have no idea how to get 7796249@N02 a:2:{s:4:user;a:3:{s:2:id;s:11:7796249@N02;s:4:nsid;s:11:7796249@N02;s:8:username;a:1:{s:8:_content;s:9:ilhan.z.y;}}s:4:stat;s:2:ok;}
I have found this example on StackOverflow: var people = new List<Person> { new
I have a web service that returns a raw string of JSON data (sample
I have this array and I want to get both ID and Description from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.