How do I save the content in the form as an Excel file? there is
Now, I want to create a button. click the button to bring up the dialog box
You can search for the PHP excel class library online.
Are you writing table list data into excel? Search for the php excel class.
Are you writing table list data into excel? Search for the php excel class.
Yes. The main reason is that php is a temporary task. I have never done it before, and I have to search for any function I need. this is a headache.
There is also how to make the html pop-up save as dialog box, and then execute the code .... I don't know about this ..
PHP excel export
Here is an example.
Use header directly
First, submit according to the normal form, and then receive it in php, and then save the received content as an excel file through the excel class of php.
$ Filename = "members ". date ('ymmd'); $ member = $ this-> Members_model-> member_for_export (); header ("Content-type: application/vnd. ms-excel; charset = utf-8 "); header (" Content-Disposition: attachment; filename=$filename.xls "); echo iconv ('utf-8', 'gbk ', 'member list '). "\ t \ n"; echo iconv ('utf-8', 'gbk', 'number '). "\ t"; echo iconv ('utf-8', 'gbk', 'Email address '). "\ t \ n"; foreach ($ member AS $ key => $ value) {$ order_by = $ key + 1; echo iconv ('utf-8 ', 'gbk', $ order_by ). "\ t"; echo iconv ('utf-8', 'gbk', $ value ['email ']). "\ t"; echo "\ n";} exit;
Save the data as an Excel file. How can I complete this .... My younger brother has just been in touch with php. This problem has been bothering me for a long time. I am very grateful .... Reply to discussion (solution) You can refer to the above code to directly copy it.