For example: File 1.txt (format of file content: Utf-8)
file_get_contents (file 1.txt) will be an error
[function.file-get-contents]: failed to open stream: No such file or directory不用中文的文件名就可以
If the path does not contain Chinese, then there is no problem.
In addition, the coding problem of this piece, there is no better solution?
If there is, ask for the relevant article portal, thanks~
Reply content:
For example: File 1.txt (format of file content: Utf-8)
file_get_contents (file 1.txt) will be an error
[function.file-get-contents]: failed to open stream: No such file or directory不用中文的文件名就可以
If the path does not contain Chinese, then there is no problem.
In addition, the coding problem of this piece, there is no better solution?
If there is, ask for the relevant article portal, thanks~
is a coding problem, in Windows is gbk
encoded in Chinese, and PHP files are generally saved in utf-8
the format. The Chinese address gets iconv('utf-8', 'gbk', $address)
no problem before doing it once.
Name the file name in Chinese really very painful ~ ~ ~
It is said that you can do urlencode first and then go to fetch!! No concrete practice.
var_dump(@file_get_contents(urlencode("我是中文名").".txt"));
File_ get_ Contents
Note:
If you want to open a URL with special characters (for example, a space), you need to use UrlEncode () for URL encoding.