Home >Backend Development >PHP Tutorial >Two methods to set php page encoding

Two methods to set php page encoding

WBOY
WBOYOriginal
2016-07-25 08:54:07990browse
  1. echo '';
Copy the code

2. On the php page or html page

Copy code

Second, use the header function In a controller or page:

  1. header("content-type:text/html; charset=utf-8");
Copy code

PHP class that implements traditional and simplified conversion within UTF-8 encoding php function to get the encoding format of a string PHP string encoding problem analysis php realizes mutual conversion between utf-8 and GB2312 encoding php code for GB2312 and UTF8 encoding conversion php does not use iconv library to convert gb2312 to utf-8 encoding function php encoding conversion function (automatic character set conversion supports array conversion) Instructions for using php encoding conversion function mb_convert_encoding and iconv php function iconv to change encoding



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