title: Allowed memory size exhausted concatenating var
body: <p>I am working on a project that generates PDF files. I am using the TCPDF library, with its method "WriteHTML".</p>
  
  <p>To write the html, I do some like this:</p>
  
  <pre><code>$html = "";
  for($i = 0; $i &lt; $someBigNumber; $i++){
      $html .= "BigData"; //Here I do a concatenate 
  }
  $pdf-&gt;WriteHTML($html, paramaters);
  </code></pre>
  
  <p>But the problem is that if $someNumber is so big or the data is so big, there is a fatal error.</p>
  
  <p>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36 bytes)</p>