在将数据上传到数据库之前,如何检查数组输入类型文件是否为空。如果有一个空则显示用户理解的任何内容并且不更新数据。
这是示例代码 html
<h3>Extra profile information</h3>
<table class="form-table">
<tr>
<th><label for="Upload">Upload</label></th>
<td>
<form action="" method="post">
<input name="profile_photo[]" type="file" value="" />
<input name="profile_photo[]" type="file" value="" />
<input name="profile_photo[]" type="file" value="" />
<br/>
</form>
</td>
</table>
我曾经使用 $x=$_GET['profile_photo'];并回显 $x;在上传到数据库之前,它返回空或null。
最佳答案
$x=$_FILES['profile_photo']['name'];
使用此代码
关于php - 如何检查输入数组字段类型文件空是否未上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16436545/