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

藏色散人
Release: 2023-03-15 06:58:01
Original
2501 people have browsed it

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')
Copy after login

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!

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