$now = gmdate('D, d M Y H:i:s') . ' GMT';
$filename ="analysis_report.xls";
header('Content-type: application/ms-excel');
header('Expires: ' . $now);
header('Content-Disposition: attachment; filename='.$filename);
header('Pragma: no-cache');
require(SB_PATH."views/export_analysis/analysis_report_export.php");
exit;
I have to export dynamic html table data in wordpress front users data comes fine but header menu also get included in excel sheet Same code working fine in wordpress backend. Here is screenshot https://prnt.sc/qyw9v6
Please suggest to correct this.