title: php exporting xls: the file format and extension of don't match
body: <p>I'm exporting xls with this code:</p>
  
  <pre><code>&lt;?php
  header("Content-Type: application/vnd.ms-excel");
  header("Content-Disposition: inline; filename=filename.xls");
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  my export
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>but when I open it, I get:<br>
  <strong>the file format and extension of don't match. the file could be corrupted or unsafe. unless you trust its source, don't open it. do you want to open it anyway?</strong><br>
  is there a way to avoid it?</p>