Job Recruitment Website - Job seeking and recruitment - How does php upload multiple files? I can upload one, and there was no mistake when I submitted it, so I ask God for advice.
How does php upload multiple files? I can upload one, and there was no mistake when I submitted it, so I ask God for advice.
foreach($ _ FILES[" pictures "][" error "]as $ key = & amp; gt; $error) {
& ampnbsp& ampnbsp& ampnbsp& ampnbspif ($error == UPLOAD_ERR_OK) {
& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp$ tmp _ name = $ _ FILES[" pictures "][" tmp _ name "][$ key];
& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp$ name = $ _ FILES[" pictures "][" name "][$ key];
& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbsp& ampnbspmove_uploaded_file($tmp_name," data/$ name ");
& ampnbsp& ampnbsp& ampnbsp& ampnbsp}
}
& ampgt;
& ltinput type = " file " name = " img[]"/& gt;
& ltinput type = " file " name = " img[]"/& gt;
Then when php gets the file information,
$ _ FILES[" img "][" name "][0]; //The name of the first picture
$ _ FILES[" img "][" name "][ 1]; //The name of the second picture
- Previous article:Tai' an passport handling consultation telephone number
- Next article:Is Changchun Boshuo School compiled?
- Related articles
- Composition of Jiangtun's Life Practice in Tengzhou City
- What is the energy supervision hotline for?
- Shoot 202 1 Buick Hideo at the store! The highest discount in Huai 'an is 45,000 yuan.
- How about Nanchang Yan Wen Logistics?
- Is Sanya Houhai Bar fun?
- Admission requirements of Changtai Gu Nong Farm Central Primary School
- How many subways are there in Luoyang?
- Shanghai Disneyland Address
- Writing a 300-word continuation of a fairy tale for fourth grade
- What occupations will surprise you when you first hear them, such as sleep tester?