Phpword Chinese Characters garbled solution _php Tutorial

Source: Internet
Author: User
Tags phpword
This article promotion people introduce phpword Chinese characters garbled solution, hope this article all help Oh.

Recently the leader asked to use PHP to generate word, online find a lot of classes ah, function ah. The final phase Phpword. Frustration is not the development of Chinese people, the support is very unfriendly. After research, finally solved the Chinese garbled, share out.

1. Use the template Word to generate word Chinese garbled solution:

Open a. phpword/template.php file, locate $replace = Utf8_encode ($replace), change it to $replace =iconv (' GBK ', ' utf-8 ', $replace); Can.

2, directly generated Word document, call AddText object when the Chinese garbled solution:

Open a. phpword/section.php file, locate $giventext = Utf8_encode ($text), change it to $giventext = Iconv (' GBK ', ' utf-8 ', $text);

3, seemingly other methods also similar to the resolution.

4, note PHP files using GBK Oh. Anyway, my display of Chinese. On the internet for a long time, studied for half a day to fix.

http://www.bkjia.com/PHPjc/632089.html www.bkjia.com true http://www.bkjia.com/PHPjc/632089.html techarticle This article promotion people introduce phpword Chinese characters garbled solution, hope this article all help Oh. Recently, the leader asked to generate word in PHP, online search for a lot of classes ah, function ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.