I have a form submitted with a single input of type of file name: photo[profile][]. I get the this array:
Array
(
[photo] => Array
(
[name] => Array
(
[profile] => Array
(
[0] => Chrysanthemum.jpg
[1] => Desert.jpg
)
)
[type] => Array
(
[profile] => Array
(
[0] => image/jpeg
[1] => image/jpeg
)
)
[tmp_name] => Array
(
[profile] => Array
(
[0] => C:\xampp\tmp\php9DCC.tmp
[1] => C:\xampp\tmp\php9E0B.tmp
)
)
[error] => Array
(
[profile] => Array
(
[0] => 0
[1] => 0
)
)
[size] => Array
(
[profile] => Array
(
[0] => 879394
[1] => 845941
)
)
)
)
So, i want a recursive function which will convert my array to this:
Array
(
[photo] => Array
(
[profile] => Array
(
[0] => Array
(
[name] => Chrysanthemum.jpg
[type] => image/jpeg
[tmp_name] => C:\xampp\tmp\php9DCC.tmp
[error] => 0
[size] => 845941
)
[1] => Array
(
[name] => Desert.jpg
[type] => image/jpeg
[tmp_name] => C:\xampp\tmp\php9DCC.tmp
[error] => 0
[size] => 845941
)
)
)
)
I need this because i want to upload more photos and set a config for each group of files.