Downloadable Excel File with PHP


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?
  2. header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  3. header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
  4. header ("Cache-Control: no-cache, must-revalidate");
  5. header ("Pragma: no-cache");
  6. header ("Content-type: application/x-msexcel");
  7. header ("Content-Disposition: attachment; filename=\"prueba.xls\"" );
  8.  
  9. echo "uno\tdos\ttres\tcuatro\tcinco\tseis\t\n";
  10. echo "siete\tocho\tnueve\tdiez\tonce\t4\t\n";
  11. echo "doce\ttrece\tcatorce\tquince\t46\tah\t\n";
  12. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.