php utf8编码上传中文文件名出现乱码
来源:程序员人生 发布时间:2014-01-19 15:33:36 阅读次数:3487次
- <?php
- if(isset($_FILES['file'])){
- $upload='upload/'.$_FILES['file']['name'];
- if(is_uploaded_file($_FILES['file']['tmp_name'])){
-
- if(!move_uploaded_file($_FILES['file']['tmp_name'],iconv('UTF-8','gb2312',$upload))){
- echo 'failed';
- }else{
- echo 'success';
- }
- }
- else{
- echo 'failed';
- }
- }
- ?>
-
-
-
-
-
- ?>
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠