This question already has an answer here:
- PHP multidimensional array decomposition 2 answers
Let's suppose I have the following array:
Array
(
[0] => Array
(
[0] => 1200
[1] => 2541
[2] => 2540
[3] => 2539
)
[1] => Array
(
[0] => Television
[1] => Monitor
[2] => Car
[3] => Bike
)
[2] => Array
(
[0] => Electrodomestic
[1] => Computer Stuff
[2] => Vehicle
[3] => Vehicle
)
)
And I would like to arrange it individually, like this:
Array
(
[0] => Array
(
[0] => 1200
[1] => Television
[2] => Electrodomestic
)
[1] => Array
(
[0] => 2541
[1] => Monitor
[2] => Computer Stuff
)
[2] => Array
(
[0] => 2540
[1] => Car
[2] => Vehicle
)
[3] => Array
(
[0] => 2539
[1] => Bike
[2] => Vehicle
)
)
How can I do that?
I would like to reoder my simple array (from data I extracted from a REGEX) into an array containing my individual "objects".
</div>