Home  >  Article  >  Backend Development  >  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
WBOYOriginal
2016-07-13 10:21:49744browse

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...
Statement:
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