Home >Backend Development >PHP Problem >How to solve the Chinese garbled problem of php's exit

How to solve the Chinese garbled problem of php's exit

藏色散人
藏色散人Original
2022-01-27 10:42:312518browse

Solution to Chinese garbled exit code in php: 1. Open the corresponding code file; 2. Add "header('Content-Type: text/html; charset=utf-8') after the namespace "That's it.

How to solve the Chinese garbled problem of php's exit

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

How to solve the problem of php exit Chinese garbled characters ?

The Chinese output of the PHP exit function is garbled

Just add the following code after the namespace

header('Content-Type:text/html;charset=utf-8')

Note:

The exit() function outputs a message and exits the current script.

This function is an alias of the die() function.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to solve the Chinese garbled problem of php's exit. 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