title: PHP weird problem with file_get_html
body: <p>Hi i am trying to use simple_html_dom for a text(website) clustering project but i have run into a weird problem. When i use echo inside the outer loop the url and the snippet are what you would expect but when i try to echo the array contents i have gathered outside the loop the urls are ok but the snippets are gone and the last snippet is in their place.</p>
  
  <pre><code>&lt;?php
    // create HTML DOM
    include("simple_html_dom.php");
    $search_query = 'something';
    $j = 1;
    $k = 1;
    /*************************GOOGLE***************************/
    for ($i = 0; $i &lt; 1; $i++) {
        $url = sprintf('http://www.google.com/search?q=%s&amp;start=%d', $search_query, 10 * $i);
        $html = file_get_html($url);
        foreach ($html-&gt;find('a[class=l]') as $element) {
            $urls[$j] = $element-&gt;href;
            echo $element-&gt;href . "\n\n\n\n\n";
            $j++;
        }
        foreach ($html-&gt;find('div[class=s]') as $element) {
            $snippets[$k] = $element-&gt;innertext;
            echo $element-&gt;innertext . "\n\n\n\n\n";
            $k++;
        }
    }
    $j = 1;
    foreach ($snippets as $elemement) {
        echo $urls[$j] . "\n" . $element . "\n\n\n\n";
        $j++;
    }
  ?&gt;
  </code></pre>