php File Upload-sample code for multiple file uploads
PHP supports uploading multiple files at the same time and automatically naming their information as an array, and it is very simple to implement such a function, simply by uploading the domain to the file in the HTML form and using the array submission syntax for the Multi box and check boxes.
Then in the previous "PHP file upload-move_uploaded_file () function" introduced the function of uploading files, just introduced the use of the function, as well as single file upload, this chapter will introduce the implementation of multi-file upload Method!
In the previous article, "PHP comprehensive use of array functions-implementation of multi-file upload," also introduced in PHP, when the browser client submitted a form request to include the uploaded file, PHP will upload the file is temporarily stored in the temporary directory, and then the upload file information stored in the global variable $_ Flies, so we just need to get the information of the uploaded file through the $_files array, and then we can do the corresponding processing operation on it!
The following instance has 4 file upload domain, the file domain name is u_file[], the file information uploaded after submission will be saved to $_files[' u_file '], generate multiple arrays, read the array information, and upload the file, the specific instance code is as follows:
The output results are as follows:
Summarize:
About the file system, we first introduced the basic operation of the file, and then learned the basic operation of the directory, then we learned the file of advanced processing technology, and finally learned the PHP file upload technology. File system is a necessary part of the development of a website, I hope you can understand the key points of knowledge of the file system, master common functions. Next topic we'll be gone!