Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我使用此语句检查文件字段是否为空时,它没有成功,
我努力了 :
if( $_files['f1'] ['size'] ===0 ){}
if (empty($_FILES['f1']['error'] === 0)){}
if( $_files['f1'] ['name'] ===0 ){}
注意:没有语法错误。
2-文件字段名称是:f1
解决办法是什么?
尝试这个
if ($_FILES['f1']['name'] === '') { }
或者
if ($_FILES["f1"]["error"] > 0) { }