In my php page i have a table and if the user requires he has to export that table to excel sheet..
The code for displaying the table is:
$sql=mysql
Easiest way to export Excel to Html table
$file_name ="file_name.xls"; $excel_file="Your Html Table Code"; header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=$file_name"); echo $excel_file;