Skip to content
Advertisement

creating multiple csv files from php loop

Im trying to create a loop that when executed it created multiple csv files and downloads them. This is my code:

JavaScript

Currently the loop created 1 CSV with a new header and the department details below it like thisenter image description here

I want the loop to create a new CSV for each department but its just not working for me. Any help is appreciated. Thanks

Advertisement

Answer

Unfortunately you can’t, 1 PHP Request results in one file, and there isn’t really a way around this. You can, however, try to download them all as a ZIP file. Take a look at this question f.e.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement