我正在用php,mysql,js制作产品管理系统。我在表格中显示所有产品清单以及详细信息。我需要用excel来制作这张桌子。我是一个excel.php页面,并将表放入具有所有列表的变量中。 并编写以下代码。但是当我点击下载按钮时,它在下载选项中显示为excel.php。我尝试了很多。但无法将其制作为xls文件。
$filename = "Export_excel.xls";
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"$filename\"");
echo $table;