title: in PHP, loop through all xml nodes and subnodes using simplexml_load_file & foreach
body: <p><a href="http://puu.sh/iPHyp/5991167dfd.xml" rel="nofollow">Given this XML document</a></p>
  
  <p>My code:</p>
  
  <pre><code>    $xml = simplexml_load_file($url);
      $table = array();
      foreach ($xml-&gt;entry as $item) {
          foreach ($item-&gt;summary-&gt;div-&gt;blockquote as $block) {
  
                  $element = array();
                  $element['title'] = $block-&gt;p;
                  $element['updated'] = strtotime($item-&gt;updated, time());
                  $table[$element['updated']] = $element;
  
          }
      }
  </code></pre>
  
  <p>I want to insert all "p" values of the "blockquote" node and put them into an array. But it only gets the last "blockquote" node, not all. </p>
  
  <p>I get this:</p>
  
  <pre><code>Warning: Invalid argument supplied for foreach() on line foreach ($item-&gt;summary-&gt;div-&gt;blockquote as $block) {
  </code></pre>
  
  <p>I need help.</p>