title: executing foreach loop only once
body: <p>As we know foreach loop will execute till condition does not become false.
  I want to execute it only once.</p>
  
  <pre><code>$i=0;
  foreach($html-&gt;find('img') as $element) 
  {    
  
         if($i!=0)  
            break;
         $logo= $element-&gt;src . '&lt;br&gt;';
         $i++;
  }
  </code></pre>
  
  <p>Is there any other solution for this? like <code>foronce</code> in place of <code>foreach</code>?</p>