How to open file in PHP that has unicode characters in its name?

后端 未结 3 874
不知归路
不知归路 2020-11-30 12:42

For example I have a filename like this - проба.xml and I am unable to open it from PHP script.

If I setup php script to be in utf-8 than all the text in script is u

3条回答
  •  孤城傲影
    2020-11-30 13:25

    You could try:

    • getting the string for the filename from a directory listing using opendir and readdir
    • passing that string to file_get _contents to see if that will work, or
    • try getting the content of the file using fopen, fread and fclose

    Hope this helps!

提交回复
热议问题