How to solve the php var_dump garbled problem

藏色散人
Release: 2023-03-09 06:52:02
Original
2800 people have browsed it

php var_dump garbled solution: 1. Open the chrome browser, select "Options-More Tools-Encoding", and then select utf-8 or unicode; 2. Add a statement before using var_dump in the code "Header("...charset=utf-8)" is enough.

How to solve the php var_dump garbled problem

The operating environment of this article: windows7 system, Chrome76.0&&php7.1 version, DELL G3 computer

php language var_dump will appear garbled characters when printing Chinese

php language var_dump will appear garbled characters when printing Chinese. There are two solutions: 1. Print the output to For common browsers such as Firefox and Chrome, you can change the encoding method of the browser. Take the Chrome browser as an example. Options-More Tools-Encoding, select utf

php language var_dump will cause garbled characters when printing Chinese. There are two solutions:

1. When printing to common browsers such as Firefox and Chrome, just change the browser's encoding method

Take the Chrome browser as an example, option - More tools - encoding, select utf-8 or unicode:

How to solve the php var_dump garbled problem

2. If the output is to an unusual browser (such as some IDEs automatically The built-in browser that comes with it) does not have the function of changing the encoding

Just add a sentence before using var_dump() in the code:

Header("Content-Type:text/html;charset=utf-8");
Copy after login

.

[Recommended learning :PHP video tutorial

The above is the detailed content of How to solve the php var_dump garbled problem. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!