title: fputcsv display leading zeros
body: <p>I'm using a PHP script to generate an excel CSV file from a result-set query.
  All works fine but when I read my excel file, I can not display leading zeros.</p>
  <p>This is my code:</p>
  <pre><code>$rows = $this-&gt;Query($sql);
  
  $filename = &quot;/www/zendsvr/htdocs/Project/public/report.xls&quot;;
  $realPath = realpath( $filename );
  
  $filename = realpath( $filename );
  $handle = fopen( $filename, &quot;w&quot; );
  $finalData = array();
  
  for( $i = 0; $i &lt; count( $rows ); $i++ ) {
      $finalData[] = array( utf8_decode( $rows[$i]-&gt;CODE ) );
  }
  
  foreach ( $finalData AS $finalRow ) {
      fputcsv( $handle, $finalRow, &quot;\t&quot; );
  }
  
  fclose( $handle );
  </code></pre>
  <p>If I make a <code>var_dump()</code> of <code>$finalData[]</code> I see the correct value, for example '000198', '000199', '000200' but the same value in my XLS file is 198,199,200</p>
  <p>How can I also display leading zeros in the XLS file?</p>