PHP function utf8 to gb2312 encoding _ PHP Tutorial

Source: Internet
Author: User
The PHP function utf8 is converted to gb2312 encoding. Today, I am too low! If the conversion is successful, you cannot see the characters. if you think there is a problem with the usage, you can view the source file. the garbled characters in the title and title cause the tag to become: the title is messy. today, I am too low! If the conversion is successful, you cannot see the characters. if there is a problem in usage, check the source file. AndThe tag becomes: Are you confused? /Title>, All content is pulled And shouted for a long time in the group. I found this problem and got angry !!!
Use the ICONV function:
Iconv ("UTF-8", "gb2312", "abc Sunshine 123 ");

It is said that this is better, you can ignore the conversion error!
Iconv ("UTF-8", "gb2312 // IGNORE", "abc Sunshine 123 ");

Success! If the conversion is successful, you cannot see the characters. if you think there is a problem with the usage, you can view the source file. the garbled characters in the title and/title cause the tag to become: the title is messy...

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.