Jump to content

Export HTML table to excel using PHP


Dharmender

Recommended Posts

  1. fputcsv ()
  2. Because this is a proprietary binary format. Only Microsoft knows for sure how it's defined, and it changes for every single Excel version released.
    This causes many problems, one of them being that any other implementation of this (which is not directly supported by MS) is actually of dubious legal nature depending upon which country you're in.

you can pretend a page is an exel file by manipulating the header. I don't know how it will translate an html table but using

header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=yourFileName.xls");
header("Pragma: no-cache");
header("Expires: 0");

will force the browser to treat the page as an exel file download.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.