Hi, please forgive my ignorance but i am new to XML and its interaction with PHP5.3. I have experimented with simpleXMLElement but can only seem to extract data from the very top level of the data returned i.e. Transaction and Code. Perhaps i am up a gumtree!
All i need to get is the reply data to SMStext messages sent via a SMStext webservice. The data will then via PHP be fed back into the MYSQL database that logs outgoing and incoming SMS messages. The XML reply is in this format below. I have visited several web help pages but i am floundering. Just a simple line of code to loop through any replies would be most helpful.
Any ideas please?
Many thanks, an XML newbie!
XML:
<GetSMSReplyResponse>
<Transaction>
<Code>1</Code>
<Description>Transaction OK</Description>
</Transaction>
<Replies>
<Reply>
<ID>1</ID>
<ClientMessageReference>afk758</ClientMessageReference>
<PartTotal>1</PartTotal>
<Originator>-----bleeped------</Originator>
<Destination>------bleeped------</Destination>
<Date>2009-06-13</Date>
<Time>17:05:41</Time>
<Body>hello world</Body>
</Reply>
<Reply>
<ID>2</ID>
<ClientMessageReference>afk759</ClientMessageReference>
<PartTotal>1</PartTotal>
<Originator>------bleeped------</Originator>
<Destination>------bleeped------</Destination>
<Date>2009-06-13</Date>
<Time>17:06:37</Time>
<Body>Hello world</Body>
</Reply>
</Replies>
</GetSMSReplyResponse>
[edited by: httpwebwitch at 1:26 pm (utc) on May 24, 2011]
[edit reason] removed phone numbers from the example [/edit]