title: fpdf generate multiple pages using a foreach loop
body: <p>I'm new to fpdf and I have this short code that prints the values of an array. My problem is that I can't figure out how to output these value on separate pages.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;?php
  require('fpdf.php');
  $pdf = new FPDF();
  
  //Create an array
  $myarray = array(1,2,3);
  
  //loop through the array with a foreach and print the results on different pages
  foreach($myarray as $value)
  {
  $pdf-&gt;AddPage();
  $pdf-&gt;SetFont('Arial','B',16);  
  $pdf-&gt;Cell(40,10,$value);
  $pdf-&gt;Output();
  
  }
  </code></pre>
  
  <p>?></p>
  
  <p>Currently the code only prints the first value and stops. Your assistance is highly valued.</p>
  
  <p>Thank you.</p>