Advertisement
djuggler

How to access simplexmlelement values?

Jan 11th, 2014
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. SimpleXMLElement(
  2. @attributes =array(
  3. ['created'] => '02 Apr 2013 20:33:51'
  4. ['creator'] => 'George'
  5. ['format'] => 1.0
  6. )
  7. Device = SimpleXMLElement(
  8. @attributes = array(
  9. ['name'] => 'Lucy'
  10. ['old_name'] =>
  11. ['phone'] => '555-1212'
  12. ['state'] => 3
  13. ['type'] => 'blonde'
  14. ['version'] => '36C'
  15. )
  16. Configuration = SimpleXMLElement(
  17.  
  18. @attributes = array(
  19. ['time'] => 418250031
  20. ['trait'] => 'available'
  21. )
  22. )
  23. )
  24. )
  25.  
  26.  
  27. How do I echo the 'name' so that my output says "Lucy"?
  28.  
  29. I get that if I set this equal to $xml I would then echo $xml['created'] for the creation date. How do I get to consecutive levels of data?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement