/**
* Created by PhpStorm.
* User: 17839
* Date: 2020/3/23
* Time: 10:54
*/
header("Content-type: text/html; charset=utf-8");
/** 文件上传
* @param $file 接受的文件 $_FILES['file']
* @param $mime 允许上传文件的类型
* @param $maxSize 允许上传的最大文件
* @param $filepath 保存文件的目录
* @return string
*/
function upload ($file, $mime, $maxSize, $filePath) {
switch ($file['error']) {
case 1:
return '文件超出了php.ini限制';
case 2:
return '文件超出了html限制';
case 3:
php封装文件上传函数
最新推荐文章于 2021-06-03 19:29:00 发布