How do you loop through $_FILES array?

前端 未结 8 865
陌清茗
陌清茗 2020-11-28 09:56

Here are the inputs I want to loop through

Main photo:   
Side photo 1: 

        
8条回答
  •  萌比男神i
    2020-11-28 10:51

    Maybe:

    Main photo:   
    Side photo 1: 
    Side photo 2: 
    Side photo 3: 
    

    $i=1;
    while (isset($_FILES['image'.$i])) {
        print_r($_FILES['image'.$i]);
        $i++;
    }
    

    If you have to loop through specific file fields.

提交回复
热议问题