Skip to content

Instantly share code, notes, and snippets.

@andrebian
Created April 1, 2014 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andrebian/9905746 to your computer and use it in GitHub Desktop.
Save andrebian/9905746 to your computer and use it in GitHub Desktop.
Um pequeno exemplo de como exportar em XLS (Excel) usando PHP.
<?php
header('Content-Type: text/html; charset=utf-8');
header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header ('Last-Modified: ' . gmdate("D,d M YH:i:s") . ' GMT');
header ('Cache-Control: no-cache, must-revalidate');
header ('Pragma: no-cache');
header ('Content-type: application/x-msexcel');
header ('Content-Disposition: attachment; filename="' . date('Y-m-d_H-i-s') . '.xls"');
header ("Content-Description: PHP Generated Data" );
?>
<table>
<tr>
<td>Crie seu conteúdo conforme o necessário</td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment