Home > Backend Development > PHP Tutorial > Two ways to set the encoding when PHP loads the page_PHP tutorial

Two ways to set the encoding when PHP loads the page_PHP tutorial

WBOY
Release: 2016-07-13 10:21:49
Original
804 people have browsed it

Two ways to set the encoding when PHP loads the page

There are two ways to set the PHP page encoding. One is to output the meta tag, and the other is to use the header function. The following is Let’s introduce it in detail

Two ways to set the page encoding when PHP loads the page

1: Output meta tag:

1. In the php mvc controller or php page echo '';

2. On the php page or html page

 2: Use header function

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/852827.htmlTechArticleTwo ways to set the encoding when PHP loads the page. There are two ways to set the PHP page encoding. One is output. meta tag, the second is to use the header function, the following is a detailed introduction to the php loading page...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template