title: PHP script stops working when handling large size of string
body: <p>I'm testing a php script to create csv file which containing large amount of data. 
  This is the way I do this task:</p>
  
  <pre><code>$csvdata = "ID,FN,LN,ADDR,TEL,PRO\n
              1,fn1,ln1,addr1,tel1,pro1\n...etc,";
  $fname = "./temp/filename.csv";
  $fp = fopen($fname,'w');
  fwrite($fp,$csvdata);
  fclose($fp);
  </code></pre>
  
  <p>I have notice that when the string ($csvdata) contain like 100,000 data rows the script work fine. But when it gets about more that 10,00,000 data rows it stop in the middle where I build the string $csvdata (I'm building $csvdata string by concatenating data in a for loop, data from database).</p>
  
  <p>Could someone let me know what's went wrong when we use large string value?</p>
  
  <p>Thank you
  Kind regards</p>