I have this associative array below:
Array
(
[0] => Array
(
[0] => Category
[1] => fruit
[2] => carbs
)
[1] => Array
(
[0] => Day 1 - Program
[1] => Eat banana
[2] => Eat bread
)
[2] => Array
(
[0] => Day 1 - record
[1] =>
[2] =>
)
)
each array index relates to the same index in the other arrays. I need to now create 3 arrays by combining the index. The finished array would look like this:
Array
(
[0] => Array
(
[0] => Category
[1] => Day 1 - Program
[2] => Day 1 - record
)
[1] => Array
(
[0] => fruit
[1] => Eat banana
[2] =>
)
[2] => Array
(
[0] => carbs
[1] => bread
[2] =>
)
)
The empty slots are where I know to put a textbox to record the data. I've tried nesting for loops and other things but nothing is working. How to combine array into a multidimensional array based on indexes?