Downloadable Excel File with PHP
Copy this code and paste it in your HTML
<?
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 ("Content-type: application/x-msexcel"); header ("Content-Disposition: attachment; filename=\"prueba.xls\"" );
echo "uno\tdos\ttres\tcuatro\tcinco\tseis\t\n";
echo "siete\tocho\tnueve\tdiez\tonce\t4\t\n";
echo "doce\ttrece\tcatorce\tquince\t46\tah\t\n";
?>
Report this snippet
Comments
Subscribe to comments