In php echo and header ("content-type: text/html; charset = uft-8"); why cannot it be used together?

Source: Internet
Author: User
In php echo and header (content-type: texthtml; charsetuft-8); why can't they be used together? In php, add the header ("content-type: text/html; charset = uft-8"); in this sentence, the android client does not receive the data sent to the android client with echo; if the above statement is removed to handle garbled text, what is garbled text received by the android client? Can you give me some advice? It is best to provide more details. thank you for your help.


Reply to discussion (solution)

Garbled issues include file encoding, file content encoding, transmission encoding ......
The file encoding is used when the file is created,
Content encoding is header ("content-type: text/html; charset = uft-8 ");
Transmission encoding, such as url encoding ......

In case of garbled code, all the codes that can be thought of are unified: utf8
In addition, header ("content-type: text/html; charset = uft-8 ");
The first sentence to be put in the file.

Thank you for choosing the first floor. this is very important for new users. please pay attention to it! I spent a lot of time on it.

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.