Issue
I have this script to let the user download file:
header('Content-Encoding: UTF-8');
header("Content-Type: application/vnd.ms-excel; charset=UTF-8");
header("Content-Disposition: attachment; filename=qa_report.xlsx");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
// echo excel file ...
exit;
The file always have a BOM marker, how can't I remove the BOM marker?
Solution
I solved this. The problem was not the script file encode but other include file that wasn't Encode with UTF8 without BOM. All the include files have to be with same encode.
Answered By - One Man Crew Answer Checked By - David Marino (PHPFixing Volunteer)