I am developing a project using PHP, and there is a need to use Scandir to list all the documents in the specified path.
When the document name is all numeric or English, the returned array is expected, and when the document name contains Chinese, Scandir does not return an array.
Could you please ask me where this problem is?
In addition to ask PHP Debugging tools, the first time using PHP development project, the development of PHP debugging is not familiar with ~
Thank you ~
Reply to discussion (solution)
Are you saying that Scandir (' Chinese directory name ') cannot return results?
If so, it means that the character set used by your program is inconsistent with the operating system's character set.
Are you saying that Scandir (' Chinese directory name ') cannot return results?
If so, it means that the character set used by your program is inconsistent with the operating system's character set.
Positive solution. transcoding
Thank you, transcoding success.
Actually in the beginning I also tried to transcode, just a few attempts have failed, thought is another problem ~
Later found that is actually transcoding the wrong way, read the document after relieved ~