Home  >  Article  >  Backend Development  >  How to export xls file in php

How to export xls file in php

WBOY
WBOYOriginal
2016-07-25 08:53:401142browse
  1. header("content-type: application/vnd.ms-excel");
  2. header("content-disposition: attachment; filename=example.xls");
  3. //Pay attention to the following The head and charset must be consistent with the encoding of the content you want to output, otherwise you may get garbled characters when you open it with excel.
  4. echo <<
  5. php output excel example
  6. Name Number Gender Birthday City
    Olympic Games 9527 Male 2008-08-08
  7. eot;
  8. ?>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn