You just need to set the correct headers to tell the browser how to handle the response, you can save yourself a lot of work with the package http://csv.thephpleague.com/examples/ or just copy hoe it creates the response.
Dec 6, 2016
5
Level 2
How to Get the Records of the table downloadable and exported in xls or csv format?
I created a table user and display the records as follows:
Date Project TicketNumber Ticketsubject Timein Timeout
2016-11-23 first 654321 My first project 09:00:00 09:10:00
2016-11-25 second 154326 My second project 09:30:00 09:40:00
2016-11-27 php 456789 Registration 10:00:00 10:20:00
2016-11-27 laravel 456789 login 11:20:00 11:30:00
2016-11-30 Third 789111 loginlaravel 11:50:00 12:00:00
2016-11-30 timesheet 567839 Records in table 12:20:00 12:35:00
2016-12-01 file 564326 file uploading 12:50:00 01:10:00
2016-12-04 database 8439123 Github 01:23:00 01:34:00
2016-12-04 Database retrieval 765893 Retreived the data 02:30:00 02:30:00
2016-12-09 Query 391750 Query Builder 03:12:00 03:23:00
« 1 2 »
Now I need to download these file as .csv or .xls .How to do it
Level 2
1 like
Please or to participate in this conversation.