This is one sweet code to export your variables and pass it on to a downloadable excel file. As of now i am working on an resume maintenance project and that needs this aspect. I googled for the simplest and efficient code.
I use a wamp localhost and faced warnings with all classes and codes that use the fopen(xls://FILENAME) format. This particular code was so cool enough to not read and open any existing file but just provide a new file that you’ll name at runtime and download.
Its more like writing the file on flyby!!
If you were one among those who googled for excel to php/php to excel/php write excel files/write excel files in php and came here, trust me its a standalone simple code below. Just copy paste and it will start working.
header(“Content-Disposition: attachment; filename=extraction.xls”);
The code is pretty self explanatory with /t for column break and \n for line break.