I have a multidimensional array. The arrays will have different lengths and seldom will they have the same length. My problem here is how can I make it so that the arrays will all share the length of the array with the biggest size?
My Array:
Array
(
[1] => Array
(
[Session 2] => Beer
[Food] => Chicken
[Drink] => Beer
)
[2] => Array
(
[Session 2] => Tea
[Food] => Aaaa
[Drink] => Ddd
[Cake] => Weee
[Brownies] => Rrrr
)
)
Expected output:
Array
(
[1] => Array
(
[Session 2] => Beer
[Food] => Chicken
[Drink] => Beer
[Cake] => ''
[Brownies] => ''
)
[2] => Array
(
[Session 2] => Tea
[Food] => Aaaa
[Drink] => Ddd
[Cake] => Weee
[Brownies] => Rrrr
)
)
The array size is not limited to only two arrays. Is this even possible and if so how?
I only want to copy the array keys and not the values its main purpose here is for presenting the content of the array in a table.