I am trying to generate an excel file with the extension .xlsx from the code below. I am able to download the file very well but when I open it with excel sheet, I receive t
From the PHP Documentation comment section, credit to cornel at scoalaweb dot com:
Don't use ob_clean() or ob_end_clean() to clear white-space or other unwanted content "accidentally" generated by included files.
Included files should not generate unwanted content in the first place.
If they do, you are doing something wrong, like inserting white-space after "?>" (there should not be a "?>" at the end of PHP files), or other errors who not follow the basic syntax rules of PHP.