title: exporting php data into excel in text data type
body: <p>I want to export my php web page to excel.</p>
  
  <p>For that, I have found the following code which works but it has an issue. </p>
  
  <p>Values in a column start with something like '00003421' in php but when it is exported in excel, it shows only '3421' in the cell. It ignores the zero values. Moreover, I want them in text data type.</p>
  
  <p>How can I export the data in plain text format as it is (including zeroes)?</p>
  
  <pre><code>header("Content-type: application/vnd.ms-excel");
  header("Content-Disposition: attachment; filename=export.xls");
  header("Content-Transfer-Encoding: BINARY");
  </code></pre>
  
  <p>It's tabular data with 4 columns and around 20,000 rows.</p>