Generated xls file opens(in MS Excel 2013) with warning
The file format differs from the format that the file name extension specifies
, if press "Yes" - file perfectly opens, but I would like without this warning. The code fragment:
header("Content-Type: application/vnd.ms-excel; charset=windows-1251");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Disposition: attachment; filename=filename.xls);
echo<<<HTML
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0">
/* many lines */
</table>
</body>
</html>
HTML
die();