Personal understanding summary of PHP multi-file upload
Multi-file upload is a basic application in PHP. I would like to introduce the relevant knowledge to you in detail. My level is limited, so please give me more opinions. Let’s all make progress together.
Add [] after the name in the FILE type of the input tag of the HTML file. The function is to create an array in the HTML to PHP. For example, the name is pictures, and the name of the multiple file reference is pictures []. The example is as follows:
Copy content to clipboard
Code:
<code id="code0"><br>
<font face="新宋体"><form action="upload.php" method="post" enctype="multipart/form-data"><br>
<p><br>
<input type="file" name="pictures[]" /><br /><br>
<input type="file" name="pictures[]" /><br /><br>
<input type="file" name="pictures[]" /><br /><br>
<input type="submit" value="上传" /><br>
</p><br>
</form> //手册中实例。</font>
//Examples in the manual.
The method manual for using HTML files to create arrays explains this:
To have your