So many time we need to export data from MySql to Excel or CSV. So many time we need to send reports in excel and we require to export data from MySql to Excel.
We can perform this task very easily in PHP. Here in this article I'm going to explain how we can export the MySql data into excel or CSV in PHP.
I will be writing single PHP script which will work for excel and CSV both. We can do it by just changing the headers of file.