Advertisement
oquidave

extract root node value

May 19th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. $xml = <<<EOD
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <SENDBATCH user='username' password='password' application='50' reply='EMAIL:dokwii@smsmedia.info'>
  4. This is a test message
  5. <SMSLIST>
  6. <SMS_SEND to='256791040262' uid='1'/>
  7. <SMS_SEND to='256754819815' uid='2'/>
  8. </SMSLIST>
  9. </SENDBATCH>
  10. EOD;
  11.  
  12. $xmlObject = new SimpleXMLElement($xml);
  13. //get the message which is This is a test message
  14. $msg = (string)($xmlObject->SENDBATCH);
  15.  
  16. //question
  17. how do i extract the message(This is a test message) from the root node(SENDBATCH) ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement