This question already has an answer here:
- Transposing multidimensional arrays in PHP 13 answers
How to get array like below format using php, i want to get simillar structure as of defined below.
My Array is like below order,
$customarray =
Array
(
[0] => Finish1
[1] => Hook1
[2] => Material1
[3] => Mounting1
)
Array
(
[0] => Finish2
[1] => Hook2
[2] => Material2
[3] => Mounting2
)
Array
(
[0] => Finish3
[1] => Hook3
[2] => Material3
[3] => Mounting3
)
Resultant array would like to below format,
$resultantArray =
Array
(
[0] => Finish1
[1] => Finish2
[2] => Finish3
)
Array
(
[0] => Hook1
[1] => Hook2
[2] => Hook3
)
Array
(
[0] => Material1
[1] => Material2
[2] => Material3
)
Array
(
[0] => Mounting1
[1] => Mounting2
[2] => Mounting3
)
Any help would be appericiated,
Thanks.
</div>