title: no loop in my scraping php script
body: <p>I make some code to scrape title and link of the title from website, the script is like this</p>
  
  <pre><code>&lt;?php
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_REFERER, 'http://dunia21.tv/?s=fast+anf+furious');
  curl_setopt($ch, CURLOPT_URL, 'http://dunia21.tv/?s=fast+anf+furious');
  
  // html
  $data = curl_exec($ch);
  curl_close($ch);
  
  //
  $output = array();
  
  // inclue simple html dom
  require('./lib/simple_html_dom.php');
  
  // ubah html jadi string
  $html = str_get_html($data);
  
  // menentukan bahan yang akan diolah, yaitu class=mag-box wide-post-box
  $bahan = $html-&gt;find('div[class=row content]', 0);
  
  // ambil kotak2 postingan dalam li class=post-item
  $kotak = $bahan-&gt;find('section[class=primary col-md-11]', 0);
  
  // ekstrak kotak
  foreach($kotak as $key =&gt; $val) {
      // title di h3 class=post-title
      $header = $kotak-&gt;find('header[class=col-xs-12 entry-header]', 0);
      $title = $header-&gt;find('a[rel=bookmark]', 0)-&gt;innertext;
      $url = $header-&gt;find('a[rel=bookmark]', 0)-&gt;href;   
  
          $output[] = array(
          'title' =&gt; $title,
          'link' =&gt; $url
          );
  }
  
  print  '&lt;pre&gt;';
  print_r($output);
  print  '&lt;pre&gt;';
  ?&gt;
  </code></pre>
  
  <p>I think this script will run according to my wishes, and this script managed to issue a response, but this script only takes the first title only, while others do not, the output is like this</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
      [1] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
      [2] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
      [3] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
      [4] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
      [5] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
      [6] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
      [7] =&gt; Array
          (
              [title] =&gt; 2 Fast 2 Furious (2003)
              [link] =&gt; http://dunia21.tv/2-fast-2-furious-2003/
          )
  
  )
  </code></pre>
  
  <p>is there any suggestion to solve this problem? thank you</p>