Implementation of UTF8 encoding in PHP

Source: Internet
Author: User

For example, the implementation method, find a lot of places, how to encode the wrong, the code itself is UTF8 encoded. How to implement string UTF8 encoding???

Reply content:

For example, the implementation method, find a lot of places, how to encode the wrong, the code itself is UTF8 encoded. How to implement string UTF8 encoding???

The Htmlentities function converts a character to an HTML entity
Html_entity_decode converting HTML entities back to characters
echo html_entity_decode('哈');Ha

Chinaz inside the UTF-8 conversion is wrong and is actually Unicode

Can this, you enter in the Baidu input box to convert the Chinese characters, and then search, copy the current address box URL, pasted in the text document, WD behind is the UTF-8 encoding of Chinese characters. Each byte is separated by%, and the general Chinese character is encoded in 3 bytes.

  • 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.