php 上传 失败 乱码 总结

php.ini中有这么一句表明了 php编码 是 default_charset="utf8";

写的网页的编码方式,是ANSI 还是 UTF-8;

网页内部声明的是什么编码方式;

header("Content-Type:text/html;charset=UTF-8 ");                      //这是php中编码声名的写法
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><!--这是HTML中编码的声名-->
$upfile = './uploads/'.time().$_FILES['myfile']['name'];     //定义上传后的位置和新文件名
    if (function_exists("iconv")){
    $upfile = iconv("UTF-8","GB2312",$upfile);      
    }

这句是缓存转向存储位置前转码,

文件缓存时候用的是什么编码方式??  

最后输出上传的文件大小时候用到了四舍五入

if($size>1024)
    {
    $size=round($size/1024,2) ."kb";
    }
原文地址:https://www.cnblogs.com/happig/p/2664089.html