php method to set the encoding format: first add [header("Content-Type: text/html; charset=utf-8")] in the php script; then set the encoding on the static page; finally ensure that all The encoding of the files is the same.
If you want to use gb2312 encoding, then PHP should output the header:
(Recommended tutorial: php graphic tutorial )
header(“Content-Type: text/html; charset=gb2312")
At the same time, add
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
to the static page and the encoding format of all files is ANSI. You can open it with Notepad, save it as and select the encoding as ANSI to overwrite the source file.
(Video tutorial recommendation: php video tutorial)
If you want to use utf-8 encoding, then php should output the header:
header(“Content-Type: text/html; charset=utf-8")
At the same time, the static page is added
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
and the encoding format of all files is utf-8.
The above is the detailed content of How to set encoding format in php. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools
