问题描述:

I am trying to write a csv file in php, so that when user clicks on an icon, it will generate a csv file using data from my database.

Everything works and I have three columns: name, date, age

I was wondering if in php, I can apply the filter.

For example, in excel, I can click on sort & filter -> filter on the first row, which will create a drop down menu with several features.

Is this possible?

Thanks in advance.

网友答案:

You can sort/filter while extracting from the database, then write the filtered and sorted data into the CSV file.

If you do this by taking inputs from a form on your web page, make sure that you validate the inputs server-side.

相关阅读:
Top