我能够通过 php 输出一个 excel 文件,它可以在 excel 中正确打开。那里没有问题。当用户在 Excel 中单击另存为时,它带有第一个选项 .txt 我如何设置标题,以便第一个选项将 .xls 与另存为。我现在使用的标题:
$filename="jaar.xls";
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename");
header("Pragma: no-cache");
header("Expires: 0");
提前致谢