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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:23:45+00:00 2026-06-12T07:23:45+00:00

Im kinda new with php and JSON, and after digging around for a response

  • 0

Im kinda new with php and JSON, and after digging around for a response I was not able to find one, I was hoping if you could help me…

I am working on a Report from with a JSON Response
The JSON response looks somewhat like this:

stdClass Object
(
[FlightInformation] => stdClass Object
    (
   [@size] => 10
     [Itinerary] => Array
       (
         [0] => stdClass Object
           (
            [bookingID] => 123456789
            [creationDate] => 10/04/2012
            [Customer] => stdClass Object
               (
                [email] => someone@aol.com
               )
               [FlightConfirmation] => stdClass Object
                  (
                    [supplierId] => AA
                    [arrivalDate] => 10/04/2012
                    [departureDate] => 10/05/2012
                    [confirmationNumber] => 0987654321
                    [RateInformation] => stdClass Object
                  (
                    [@size] => 1
                    [RateDescription] => stdClass Object
                        (
                         [@promo] => false
                         [ChargeableInfo] => stdClass Object
                             (
                              [@total] => 57.94

I building a Report that is like this..

foreach( $response->FlightInformation->Itinerary as $output) {

    echo $output-> bookingID;
    echo $output-> creationDate;
    echo $output-> arrivalDate;         <<<< won't Print
    echo $output->departureDate;    <<<< won't Print
    echo $output->total;            <<<< won't Print

and some more elements… but anything that is under an object inside de Itinerary Array won’t show..
I cannot get to print thes values indicated, please help…

Cheers

  • 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-12T07:23:46+00:00Added an answer on June 12, 2026 at 7:23 am

    That is because arrival, departure and total are objects themselves. You would have to do something like:

     $output->Customer->FlightConfirmation->arrivalDate;
     $output->Customer->FlightConfirmation->departureDate
     $output->Customer->FlightConfirmation->RateInformation->RateDescription->ChargeableInfo->total;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goodmorning everybody! I'm not completely new to PHP as in self but still kinda
HI Guys, Im kinda new to php and xml so pls bear with me.
Hay guys. I'm kinda new to OOP in PHP. I've learnt how to write
I'm kinda new in php. Can you tell me what is the best way
I'm kinda lost and need some help. In the past i have used php
I'm kinda of new to PHP, can you please clarify about the below preg_match.
I'm fairly new to using JSON objects and I'm kinda stuck. I've got an
I am kinda new to PHP, so I now have started using Pear where
I'm kinda new to PHP and I'm trying to add a tag within a
I'm kind of new to php, and I'm trying to send a file through

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.