How to solve the problem of php glob garbled characters

藏色散人
Release: 2023-03-13 14:48:02
Original
2190 people have browsed it

Solution to php glob garbled characters: 1. Check and modify the web server character set and page character set; 2. Modify the configuration file content to "AddDefaultCharset UTF-8".

How to solve the problem of php glob garbled characters

The operating environment of this article: Windows7 system, PHP7.1 version, DELL G3 computer

php glob How about Chinese garbled characters deal with?

<?php
print_r(glob("*.txt"));
?>
Copy after login

But when the file name in the root directory is in Chinese, the output will appear. How to deal with garbled characters?

For example, create a new folder .txt

Solution:

Check the character set settings of your web server and the character set settings of the page .

If it is apache, the configuration file includes:

AddDefaultCharset UTF-8
Copy after login

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to solve the problem of php glob garbled characters. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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