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 6050059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:38:47+00:00 2026-05-23T07:38:47+00:00

I’m trying to learn how to use CURL and Json to access data sent

  • 0

I’m trying to learn how to use CURL and Json to access data sent from the Facebook graph api.

I’m using the following function which pulls the post data:

 function loadFB($fbID){
      $url="https://graph.facebook.com/".$fbID."/feed?limit=1&access_token=xxxx";
      $c = curl_init($url);
      curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
      $page = json_decode(curl_exec($c));
      curl_close($c);
      $post=reset($page->data);

      if($post->message == '') {

        $post_msg = '<a href="' . $post->link . '">' . $post->name . '</a>';

      } else {

        $post_msg = $post->message;

      }

      return $post_msg;
 }

Example JSOn data looks like this:

{
"data": [
  {
     "id": "xxxx",
     "from": {
        "name": "xxx",
        "category": "xxx",
        "id": "xxx"
     },
     "picture": "xxxxxxxxx",
     "link": "xxxxxxx",
     "name": "Event name goes here",
     "properties": [

        {
           "text": "Friday, July 15, 2011 at 4:00pm"
        },
        {
           "text": "Venue Name"
        }
     ],
     "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yW/r/r28KD-9uEMh.gif",
     "type": "link",
     "object_id": "xxx",
     "created_time": "2011-06-23T06:46:17+0000",
     "updated_time": "2011-06-23T06:46:17+0000",
     "likes": {
        "data": [
           {
              "name": "xxxx",
              "category": "xxx",
              "id": "xxxx"
           }
        ],
        "count": 1
     }
  }
],
"paging": {
  "previous": "xxxxx",
  "next": "xxx"
}
 }

As it stands, I can retrieve the message of a page update, or if its an event I can retrieve the event name and the link for the event.

But what if I want to retrieve say the event date or the venue name? Its under another tier of ‘properties’.

With my code so far, I can access the first level of things with $post->message, but when I try $post->properties->text this doesn’t work – so I don’t understand how this works. On top of that, in the ‘properties’, there’s 2 ‘text’ which is adding to my confusion of how to access these things.

Any pointers?

  • 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-23T07:38:47+00:00Added an answer on May 23, 2026 at 7:38 am

    $post->properties is an array so :

    $post->properties[0]->text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I'm parsing an XML file, the creators of it stuck in a bunch social

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.