title: PHP How can I split li items from a ul list by class?
body: <p>I am trying to use Simple DOM Parser, to parse each <strong>li</strong> item in the <strong>ul</strong> list by the class name. Below you can see the code I am trying to parse, but keep in mind it's from a html source code, just selected the code I want to parse.</p>
  
  <p>I have tried with this PHP code, but it doesn't work at all..</p>
  
  <pre><code>include 'simple_html_dom.php';
  
  $url = "http://www.pinterest.com/avast/";
  
  $html = file_get_html( $url );
  $first_level_items = $html-&gt;find( '.userStats', 0)-&gt;children();
  
  foreach ( $first_level_items as $item ) {
  print_r($first_level_items);
  }
  </code></pre>
  
  <p>This is the ul list I want to get the li items from.</p>
  
  <pre><code>&lt;ul class="userStats"&gt;
  
  &lt;li&gt;
  &lt;a href="/avast/boards/" type="button" class="NavigateButton Button Module ButtonBase hasText borderless active BoardCount"&gt;
  &lt;span class="buttonText"&gt;    
    13 opslagstavler    
  &lt;/span&gt;
  &lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li&gt;
  &lt;a href="/avast/pins/"&gt;
  &lt;div class="PinCount Module"&gt;
    317 pins    
  &lt;/div&gt;
  &lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li&gt;
  &lt;a href="/avast/likes/"&gt;
    1 synes om    
  &lt;/a&gt;
  &lt;/li&gt;
  
  &lt;/ul&gt;
  </code></pre>
  
  <p>Any help would be appreciated!</p>