An error was reported in the word document generated by phpword download.

phpword download generates word document error, and the file content garbled problem is solved by commenting out $value = utf8_encode ($value); has been solved, but the file opening time will report an error, although it can be opened eventually, but the user experience is not very good. God, come and help solve it. No, no, no.


:

Php
Feb.28,2021

I encountered the same problem. After debugging several times, I found that I just need to add an exit (); to $objWriter- > save ("php://output") to solve this problem.


Thank you very much for solving the problem, that is, adding an exit; is not expected to be so disgusting.


seniors, I also encounter this problem now. It works well under win7, but the file is corrupted when it is opened under mac. Now the method of toutf8 is put into other classes. I try to comment out or the file is corrupted. Is there any way

?
Menu