Home  >  Article  >  Backend Development  >  What should I do if the file name saved in php is garbled?

What should I do if the file name saved in php is garbled?

藏色散人
藏色散人Original
2020-08-06 10:39:322808browse

The garbled file name saved by php is caused by the inconsistency between the system and the file encoding. The solution is to convert the encoding during storage. The statement is "move_uploaded_file($temploadfile,iconv("utf-8"," gb2312",$uploadfile)".

What should I do if the file name saved in php is garbled?

Recommended: "PHP Video Tutorial"

Because the system is gb2312 as The file name is encoded, so the Chinese name generated by the utf-8 PHP file must be garbled.

We need to convert the encoding when storing.

move_uploaded_file($temploadfile,iconv("utf-8","gb2312",$uploadfile))

The above is the detailed content of What should I do if the file name saved in php is garbled?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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