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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:21:47+00:00 2026-05-28T03:21:47+00:00

An incoming data feed is in the form of an array. However, each array

  • 0

An incoming data feed is in the form of an array. However, each array element contains multiple data fields (both field name and field data). The sample below shows the content of each array element. Using PHP, how do I extract the field names and the associated data?

Thanks for your assistance!

stdClass Object (
    [Cancelled] =>
    [MessageID] => 999999
    [Queued] =>
    [ReferenceID] => FRIDAY
    [SMSError] => NoError
    [SMSIncomingMessages] => stdClass Object (
        [SMSIncomingMessage] => stdClass Object (
        [FromPhoneNumber] => 1999999999
        [IncomingMessageID] => 0byyyyyyy 
        [Message] => 45-64-07
        [ResponseReceiveDate] => 2012-01-07
    )
)
[Sent] => 1
[SentDateTime] => 2012-01-07)
  • 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-28T03:21:47+00:00Added an answer on May 28, 2026 at 3:21 am

    What you have isn’t exactly an array, but an object instead, so you have to access it using pointers. I’ll show a couple examples:
    In this example, I’ll call your output $output

    If this were an array, you would call elements like this:

    echo $output['MessageID'];
    echo $output['SMSIncomingMessages']['SMSIncomingMessage']['IncomingMessageID'];
    

    But since this is an stdClass Object, you’ll have to access it like this:

    // will echo 999999
    echo $output->MessageID;
    

    It’s also the same with multi-dimensions:

    // will echo 0byyyyyyy
    echo $output->SMSIncomingMessages->SMSIncomingMessage->IncomingMessageID;
    

    You can still loop through the object like you would an array, but when you access the elements of the array, they still have to be accessed using a pointer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a method that handles incoming data objects. It must handle each
I have a form using jQuery that I need to manipulate the incoming data.
I am having a continuously incoming data represented by an array of integer x
I have an class which should send/receive data in packet form. This class contains
Suppose I am processing a large amount of incoming data from multiple threads. I
I need to perform update/insert simultaneously changing structure of incoming data. Think about Shops
My Perl app and MySQL database now handle incoming UTF-8 data properly, but I
I need to process the incoming predefined ASN format data(coming from verity of clients
I'm having difficulties displaying data in a UITextView in iPhone programming. I'm analyzing incoming
I have the following directory structure: +-archive +-a +-data.txt +-b +-data.txt +-incoming +-a +-data.txt

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.