Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <features>
  2. <name>Holy moly</name>
  3. ....
  4.  
  5. </features>
  6.  
  7. <features>
  8.  
  9. <name>what the...</name>
  10. ...
  11.  
  12. </features>
  13.  
  14. <?php
  15. include 'example.php';//heres my xml content
  16.  
  17. $features = new SimpleXMLElement($xmlstr);
  18.  
  19. /* For each <character> node, we echo a separate <name>. */
  20. foreach ($features->properties as $properties) {
  21. echo "<br />".$properties->name, ' played by ', $properties->website, PHP_EOL;
  22. }
  23.  
  24. ?>
  25.  
  26. foreach ($root->features as $features) {
  27. foreach ($features->properties as $properties) {
  28. echo "<br />".$properties->name, ' played by ', $properties->website, PHP_EOL;
  29. } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement