Job Recruitment Website - Zhaopincom - How does php upload multiple pictures in one file? I can upload a picture like this, and there is no mistake in the picture when I submit it. Please ask God for advice.
How does php upload multiple pictures in one file? I can upload a picture like this, and there is no mistake in the picture when I submit it. Please 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:Is there a salesman who makes feed? Say it.
- Next article:What about Taijiaisi (China) Investment Co., Ltd.?
- Related articles
- Brief introduction of Beijing Kaike Weishi Technology Co., Ltd.
- How about Baolong Store of Hefei Department Store Group Bengbu Top 1 Shopping Center Co., Ltd.?
- Eagle studio training charge standard 2023
- Demolition planning of Wujiang District, Suzhou
- How can Qingdao go to Dalian by boat?
- What's the telephone number of Suzhou Xinkai Pharmacy Chain Co., Ltd.
- How about Changzhou Zhenyang Electronics Co., Ltd.?
- What about Little Red Riding Hood Kindergarten in fengqiu county?
- Is Renqiu's teacher recruitment good?
- Is Shijiazhuang Southeast Experimental Primary School public or private?