title: PHP simplexml  get image display
body: <p>I have an xml that looks something like this:</p>
  
  <pre><code>&lt;gallery server="5"&gt; 
      &lt;image path="http://i.imgur.com/8n5MB.jpg"/&gt;
      &lt;image path="http://i.imgur.com/TIXL2.jpg"/&gt;
  &lt;/gallery&gt;
  </code></pre>
  
  <p>I'm trying to get the images to display in one page using PHP. This is what I have:</p>
  
  <pre><code>$xml = simplexml_load_file('./images.xml');
  
  echo $xml-&gt;getName() . "&lt;br /&gt;";
  
  foreach($xml-&gt;children() as $child)
    {
    echo $child-&gt;getName() . "&lt;br /&gt;";
    }
  </code></pre>
  
  <p>My problem is that this only outputs the following</p>
  
  <pre><code>gallery
  image
  image
  image
  </code></pre>
  
  <p>I can't find any information on how to read the information of the tag itself, any pointers? Thanks!</p>