Question: how to export table data in excel in php?
Answer: xls"; // File Name // Download file header("Content-Disposition: attachment; filename=\"$filename\""); header("Content-Type: application/vnd. ms-excel"); $user_query = mysql_query('select name,work from info'); // Write data to file $flag = false; while ($row = mysql_fetch_assoc($user_query)) { if (!