What to do if the php directory file name is Chinese garbled

藏色散人
Release: 2023-03-13 15:16:01
Original
2351 people have browsed it

Solution to Chinese garbled names of php directory files: 1. Read the Chinese word files in the specified folder and generate a list of file names; 2. Use "iconv('GB2312', 'UTF-8' $v )" method to convert the encoding.

What to do if the php directory file name is Chinese garbled

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

What to do if the php directory file name is Chinese garbled ?

php solution for reading garbled Chinese file names in the directory:

Recent project needs to read Chinese word files in the specified folder and generate a list of file names .

Direct reading will cause garbled characters, and there is a problem with the file name and table name.

Solution:

Loop the read file name and convert the encoding

iconv('GB2312', 'UTF-8' $v)
Copy after login

Recommended study: "PHP Video Tutorial"

The above is the detailed content of What to do if the php directory file name is Chinese garbled. 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!