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".
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")); ?>
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
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!