title: PHP Simple HTML DOM Parser - loop
body: <p>I started to play Simple HTML Doom Parser and I have some trouble:</p>
  
  <p>The HTML code is as follows:</p>
  
  <pre><code>&lt;div class="players"&gt;
      &lt;ul class="dane"&gt;
          &lt;li&gt;
              &lt;div class="name"&gt;Messi&lt;/div&gt;
              &lt;div class="value"&gt;Barcelona&lt;/div&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;div class="name"&gt;Ronaldo&lt;/div&gt;
              &lt;div class="value"&gt;Madryt&lt;/div&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div class="clubs"&gt;
      &lt;ul class="dane"&gt;
          &lt;li&gt;
              &lt;div class="name"&gt;Barcelona&lt;/div&gt;
              &lt;div class="value"&gt;Hiszpania&lt;/div&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;div class="name"&gt;Madryt&lt;/div&gt;
              &lt;div class="value"&gt;Hiszpania&lt;/div&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div class="trenerzy"&gt;
      &lt;ul class="dane"&gt;
          &lt;li&gt;
              &lt;div class="name"&gt;Ernesto Valverde&lt;/div&gt;
              &lt;div class="value"&gt;Barcelona&lt;/div&gt;
          &lt;/li&gt;
          &lt;li&gt;
              &lt;div class="name"&gt;Madryt&lt;/div&gt;
              &lt;div class="value"&gt;Zidane&lt;/div&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My PHP code: </p>
  
  <pre><code>include_once('simple_html_dom.php');
  $html = file_get_html('http://');
  
  $articles = array();
  foreach($html-&gt;find('ul.dane') as $article) {
      $item['name']     = $article-&gt;find('div.name',0)-&gt;plaintext;
      $item['value']    = $article-&gt;find('div.value',0)-&gt;plaintext;
      $articles[] = $item;
  }
  
  print_r($articles);
  </code></pre>
  
  <p>The data it receives is:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [name] =&gt;                   Messi               
              [value] =&gt;                      Barcelona               
          )
  
      [1] =&gt; Array
          (
              [name] =&gt;                   Barcelona               
              [value] =&gt;                      Hiszpania               
          )
  
      [2] =&gt; Array
          (
              [name] =&gt;                   Ernesto Valverde                
              [value] =&gt;                      Barcelona               
          )
  </code></pre>
  
  <p>It receives data from the data class ul.dane but only 1 record, how can I do to get everything that is on the page?</p>
  
  <p>I know I'm missing a loop somewhere, but I have a problem finding wher</p>