From 1e7724be96e8da482e7559e05be899e170690914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B5=B7=E6=B6=8C=E2=80=9Dgit=20push=20git=20con?= =?UTF-8?q?fig=20--global=20user=2Eemail=203480707803=40qq=2Ecom=20git=20c?= =?UTF-8?q?onfig=20--global=20user=2Ename=20=E5=90=B4=E6=B5=B7=E6=B6=8C?= =?UTF-8?q?=E2=80=9D?= <3480707803@qq.com> Date: Sun, 22 May 2022 22:56:17 +0800 Subject: [PATCH] text --- ...07\344\273\266\344\270\212\344\274\240.md" | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 "\345\220\264\346\265\267\346\266\214/20220518-php\346\226\207\344\273\266\344\270\212\344\274\240.md" diff --git "a/\345\220\264\346\265\267\346\266\214/20220518-php\346\226\207\344\273\266\344\270\212\344\274\240.md" "b/\345\220\264\346\265\267\346\266\214/20220518-php\346\226\207\344\273\266\344\270\212\344\274\240.md" new file mode 100644 index 0000000..8fa18a2 --- /dev/null +++ "b/\345\220\264\346\265\267\346\266\214/20220518-php\346\226\207\344\273\266\344\270\212\344\274\240.md" @@ -0,0 +1,60 @@ +### 笔记 + +```php +define('size',1024*1024);//define 如果成功则返回 true ,失败则返回false 默认是true +$b = $_files['f']['size'];//把文件赋值给b + +if($b + + + + 提交 + + +
+ + 请输入你要传输的文件: +
+ + +
+ + +``` + +```php +SIZE){ + echo "上传文件太大了!"; + }else{ + echo "上传文件太小了!"; + } + $array = array("pdf","docx"); + $name = $_FILES['file']['submit']; + $nameArr = expllode("".",$name"); + $lastname = $nameArr[count($nameArr)-1]; + $result = array_search($lastname,$array); + if ($result===false){ + echo "上传文件格式错误!"; + }else{ + echo "上传文件格式正确";} +} +``` + -- Gitee