Php code garbled

Source: Internet
Author: User
& Amp; lt ;? Php {code ...}? & Amp; gt; how to solve the problem by printing out garbled code in this way? I checked it online and changed the encoding format. Please kindly advise.
Header ("Content-type: text/html; charset = UTF-8"); echo "yes ";

?>
How can we solve the problem by printing out garbled code? I found it online and changed the encoding format. Please kindly advise.

Reply content:

Header ("Content-type: text/html; charset = UTF-8"); echo "yes ";

?>
How can we solve the problem by printing out garbled code? I found it online and changed the encoding format. Please kindly advise.

The Content-Type statement tells the browser that the encoding Type of the data you return is UTF-8, so your source code text should also correspond to UTF-8 encoding. open the editor, such as Geany, and then set the file encoding to a UTF-8, so that the browser can normally display the Chinese.

Use the nodepad ++ text editor or the IDE right-click File to change the file encoding format to be output.

First, make sure that the edited text is UTF-8,
Again, make sure that the output is UTF-8,
If there is a database. Please confirm database UTF-8
Multi-Check

I also encountered this problem when using sublime. I obviously saved the text in UTF-8 format.
Later, I had to open the root directory of the file and then open it and save it as a text file, and then select the encoding format.
You also need to set the encoding for the browser font.

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.