Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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