That’s it."/> That’s it.">

Home  >  Article  >  Backend Development  >  Garbled characters appear when opening PHP files

Garbled characters appear when opening PHP files

王林
王林Original
2019-09-29 17:47:475168browse

Garbled characters appear when opening PHP files

Setting the following three character sets to be consistent can solve the problem of garbled characters after running the php file.

1. Character set of PHP editor

Taking Zend Studio as the editor of PHP program as an example, create a project , set the character set to "UTF-8".

2. The predefined character set used by the web page

Before the .php file or .html file to be run, add the characters for the web page The predefined statement of the set:

<meta http-equiv="Content-type"  Content="text/html;charset=UTF-8;" />

3. The character set of the browser to view the web page

Take the firefox browser as an example. After completing the first two steps, run the .php program. If garbled characters still appear, click the browser option bar > View > Change encoding > UTF-8.

Recommended tutorial: PHP video tutorial

The above is the detailed content of Garbled characters appear when opening PHP files. 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 a page in phpNext article:How to call a page in php