Home > Article > Backend Development > How to solve the Chinese garbled problem of php's exit
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.
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!