Home > Backend Development > PHP Problem > How to change file encoding format in php

How to change file encoding format in php

藏色散人
Release: 2023-03-10 22:30:01
Original
3021 people have browsed it

php method to change the file encoding format: 1. Modify the encoding according to the software used to write PHP; 2. Add "header("Content-type: text/html; charset=utf-8 to the PHP file ");".

How to change file encoding format in php

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

How does php change the file encoding format?

1. The encoding format of the php file itself:

The operation method is different depending on the software used to write php, such as phpDesigher software:

How to change file encoding format in php

2. In the PHP file content, you need to set the encoding format required for browser parsing:

In the PHP file code, insert

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

which is equivalent to html

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Copy after login

Recommended learning: "PHP Video Tutorial"

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

Related labels:
php
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