I need to get the data out of an XML response./

Hi,  Thankyou experts for helping out!

i am submitting some data to an API.

I get back the below packet:
object(stdClass)#4 (7) {
  ["nextpageuri"]=>
  NULL
  ["previouspageuri"]=>
  NULL
  ["sms_messages"]=>
  array(1) {
    [0]=>
    object(stdClass)#5 (7) {
      ["created"]=>
      string(31) "Tue, 13 Mar 2018 00:02:15 +0000"
      ["id"]=>
      string(32) "406e3658b6c0c0984dacee9298b0c5d8"
      ["from"]=>
      string(10) "0419697XXX"
      ["destination"]=>
      string(11) "61402374XXX"
      ["message"]=>
      string(86) "Hi Jimmy, Broken SMS begun."
      ["uri"]=>
      string(48) "/2016-11-30/sms/406e3658b6c0c0984dacee9298b0c5d8"
      ["receipts"]=>
      object(stdClass)#6 (1) {
        ["delivered"]=>
        string(31) "Tue, 13 Mar 2018 00:02:25 +0000"
      }
    }
  }
  ["message"]=>
  string(16) "Response follows"
  ["api_version"]=>
  string(10) "2016-11-30"
  ["status"]=>
  int(200)
  ["uri"]=>
  string(48) "/2016-11-30/sms/406e3658b6c0c0984dacee9298b0c5d8"
}

Open in new window


Could someone please help me serialise it?

I want to gain access to this part:
      ["receipts"]=>
      object(stdClass)#6 (1) {
        ["delivered"]=>
        string(31) "Tue, 13 Mar 2018 00:02:25 +0000"
      }

Open in new window


Basically I want whatever is in the section "Delivered".

Could someone please help?
mavmanauNetwork Engineer/SysadminAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
What you posted above...  Are you receiving that as a string, or are you receiving the object, and posting the export of that object here?

If you're receiving the object, then it is a simple matter of tracing the properties down.  For example, if you receive that object into a variable called "my_var", then you can access the "Delivered" property with:
$my_var->sms_messages[0]->receipts->delivered

Open in new window

2

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mavmanauNetwork Engineer/SysadminAuthor Commented:
many thanks - you were of great assistance!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.