Home  >  Article  >  Backend Development  >  How to add utf8 in php

How to add utf8 in php

(*-*)浩
(*-*)浩Original
2019-09-19 13:50:123153browse

How to add utf8 in php

PHP sets the encoding of the file, the statement used:

header("Content-Type: text/ html;charset=Specify encoding"); (Recommended learning: PHP programming from entry to proficiency)

How to add utf8 in php

## Why do we need to set the character set encoding of the file?

How to add utf8 in php

As shown below, it is because the browser cannot correctly identify the encoding of the file, resulting in abnormal display

How to add utf8 in php

Example Demo, specify the encoding of the file

How to add utf8 in php

Save the file and view the correctly encoded content output in the browser,

How to add utf8 in php

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

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
Previous article:How to call ffmpeg in phpNext article:How to call ffmpeg in php