title: Limiting the number of JSON objects to process
body: <pre><code>&lt;?php
  // JSON URL which should be requested
  $json_url = 'https://api.feedbin.me/v2/entries.json';
  
  $username = 'username';  // authentication
  $password = 'password';  // authentication
  
  // Initializing curl
  $ch = curl_init( $json_url );
  
  // Configuring curl options
  $options = array(
  CURLOPT_RETURNTRANSFER =&gt; true,
  CURLOPT_USERPWD =&gt; $username . ":" . $password   // authentication
  );
  
  // Setting curl options
  curl_setopt_array( $ch, $options );
  
  // Getting results
  $result =  curl_exec($ch); // Getting JSON result string
  
      $i=0;
      foreach (json_decode($result) as $obj) {
      if($i==5) break;
          $feedbin_title = $obj-&gt;title;
          $feedbin_url = $obj-&gt;url;
          echo '&lt;li&gt;&lt;a href="', $feedbin_url, '"&gt;', $feedbin_title, '&lt;/a&gt;&lt;/li&gt;';
      }
  ?&gt;
  </code></pre>
  
  <p>I get a 100 objects JSON result. I'm trying to limit the objects processed to the first 5.
  Why doesn't work the <code>$i=0; if($i==5) break;</code> thing? :)</p>