Home > Backend Development > PHP Problem > How to set encoding in php

How to set encoding in php

爱喝马黛茶的安东尼
Release: 2023-02-23 13:28:01
Original
12335 people have browsed it

How to set encoding in php

Define a php page in the php header as UTF encoding or GBK encoding.

Related recommendations: "PHP Tutorial"

The php page is utf encoded:

header("Content-type: text/html; charset=utf-8");
Copy after login

The php page is gbk encoded:

header("Content-type: text/html; charset=gb2312");
Copy after login

php page is big5 encoded:

header("Content-type: text/html; charset=big5");
Copy after login

Usually, just put the above code on the home page of the php page.

The above is the detailed content of How to set encoding in php. For more information, please follow other related articles on the PHP Chinese website!

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