Home > Article > Backend Development > What should I do if the file name saved in php is garbled?
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)".
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!