title: PHP how to echo during a foreach loop rather than at the end?
body: <p>I'm quite new to PHP and have been having some trouble with figureing something out. Whenever I use a foreach loop to echo something to the screen, it only echos once the loop has finished. This makes the page loading time quite long.</p>
  
  <p>Is there a way to make it echo as soon as the loop has iterated?</p>
  
  <p>For example, </p>
  
  <pre><code>foreach ($a as $k =&gt; $v){
      echo $k . " : " . $v;
  }
  </code></pre>
  
  <p>I would like it to echo as soon as it's completed one loop rather than at the end.</p>
  
  <p>Any help is greatly appreciated!</p>