How do you loop through $_FILES array?

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

Here are the inputs I want to loop through

Main photo:   
Side photo 1: 

        
8条回答
  •  一生所求
    2020-11-28 10:35

    I'm way late to the game for this answer but I got tired of solving the problem of dealing with the PHP files array over and over, so I wrote a composer package so I'd never have to again. Maybe someone googling will find my answer and be happy.

    Install tvanc/files-array-organizer

    composer require tvanc/files-array-organizer
    

    Pass $_FILES to it, and it'll give you back an array that's structured the way you were expecting.

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

提交回复
热议问题