Garbled characters appear in Chinese file names uploaded by php

WBOY
Release: 2016-07-28 08:28:33
Original
1147 people have browsed it

1. The PHP upload file database saves files with normal Chinese file names. You can go to the server to check that the Chinese file names are garbled. I am puzzled and ask for help from Baidu.

2. Mainly due to inconsistent encoding during uploading. Garbled characters

3. It turns out that you only need to do this when moving_uploaded_file

move_uploaded_file($_FILES["file"]["tmp_name"],iconv("UTF-8", "gb2312", "photo/".$_FILES["file"]["name"]))

The above has introduced the garbled Chinese file name uploaded by PHP, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template