Two ways to set php encoding when loading pages _ PHP Tutorial

Source: Internet
Author: User
These two methods are used to set the encoding when php loads a page. There are two ways to set php page encoding when loading pages. one is to output the meta tag, and the other is to use the header function, the following describes in detail the php loading page encoding methods for setting php loading pages.

There are two ways to set php page encoding: one is to output the meta tag and the other is to use the header function. The following describes in detail.

Two methods for setting page encoding when php loads a page

1: output meta tag:

1. echo ''in the controller of php mvc or on the php page '';

2. on the php page or html page

2: Use the header function

In the controller or page header ("content-type: text/html; charset = utf-8 ");

There are two ways to set php page encoding for the plugin: one is to output the meta tag and the other is to use the header function. The following describes the php loading page in detail...

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.