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

  • Home
  • SEARCH
  • 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 8794981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:19:30+00:00 2026-06-13T23:19:30+00:00

this is a two part question. First, I have code to make a call

  • 0

this is a two part question. First, I have code to make a call to graph.facebook.com with parameters that the user can enter. This returns a json when called.

The code is below:

$RAW_DATA = json_decode(file_get_contents($URL_FINAL));

If I go to the URL in my browser everything is fairly organized but if I use a var_dump() it looks like there are extra fields not shown in the browser, is there something wrong with my decoding or is it var_dump() showing things that I don’t see on my browser?

Second, after retrieving the JSON trying to access the subfields of data within it have proven to be problem.

For example:

     {
   "data": [
      {
         "id": "11111111_111111111",
         "from": {
            "name": "John",
            "id": "111111111"
         },
         "story": "John shared We Are Change's photo.",
         "picture": "http://photos-e.ak.fbcdn.net/hphotos-ak-prn1/35552_10151311513538690_352701444_s.jpg",
         "link": "http://www.facebook.com/photo.php?fbid=10151311513538690&set=a.10150159213018690.338979.86518833689&type=1",
         "name": "Timeline Photos",
         "caption": "Happy election day everybody!",
         "properties": [
            {
               "name": "By",
               "text": "We Are Change",
               "href": "http://www.facebook.com/WeAreChange.org?ref=stream"
            }
         ] 
}

This is what the URL returns, how would I pull just the ‘story’ from this?

I have tried several different syntax styles but the only one that returns anything is $RAW_DATA->{'data'}; and this just prints ‘Array’. As soon as I try to go into the next layer I can’t get anything to print.

  • 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-06-13T23:19:31+00:00Added an answer on June 13, 2026 at 11:19 pm

    That’s because “data” is an array of objects (or associative arrays).

    $RAW_DATA->{'data'}[0];
    

    Would work if you always knows it only has one element, otherwise you should loop through $RAW_DATA->{‘data’}.

    Or to simplify:

    $RAW_DATA['data'][0]['story']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a two part question, but I want to make sure the first
This is a two part question. I have a class that gets all processes
This is a two-part question: First, I am interested to know what the best
This is a two part question. The first is how do you properly close
This is kinda....a two part question. The first one is much more important than
This is two part question: I have two stored procedures: sp1 & sp2. If
This question has two parts. Part 1. Yesterday I had some code which would
This is a two part question: Part 1 First, dealing with calculating the entropy
This question actually has two parts. The first part: I've been developing my first
This is a two part question. The first is a specific question about DataSets

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.