I recently used php to generate word. I found many classes and functions online. Phpword in the final phase. It is not developed by Chinese people, and it is unfriendly to Chinese support. After research, we finally solved Chinese garbled characters and shared them. 1. use the Template word to generate Chinese garbled characters. Solution: Open the phpword/Template. php file and find $ replaceutf8_encode ($ replac
I recently used php to generate word. I found many classes and functions online. Phpword in the final phase. It is not developed by Chinese people, and it is unfriendly to Chinese support. After research, we finally solved Chinese garbled characters and shared them.
1. use the Template word to generate Chinese garbled characters. Solution: open phpword/Template. in the php file, find $ replace = utf8_encode ($ replace); change it to $ replace = iconv ('gbk', 'utf-8', $ replace.
2. generate a Word document directly and call the addText object with Chinese garbled characters. Solution: open phpword/Section. in the php file, find $ givenText = utf8_encode ($ text); change it to $ givenText = iconv ('gbk', 'utf-8', $ text.
3. it seems that other methods are similar to the solution.