Let's say I have an array like this:
array (
0 =>
array (
'trip' => '1',
'times' =>
array (
0 =>
array (
'order' => '1',
'stop name' => 'Name 1',
'stop time' => '7:03 am',
),
1 =>
array (
'order' => '2',
'stop name' => 'Name 2',
'stop time' => '8:03 am',
),
2 =>
array (
'order' => '3',
'stop name' => 'Name 3',
'stop time' => '9:03 am',
),
),
),
1 =>
array (
'trip' => '2',
'times' =>
array (
0 =>
array (
'order' => '1',
'stop name' => 'Name 1',
'stop time' => '10:03 am',
),
1 =>
array (
'order' => '2',
'stop name' => 'Name 3',
'stop time' => '11:03 am',
),
),
),
0 =>
array (
'trip' => '3',
'times' =>
array (
0 =>
array (
'order' => '1',
'stop name' => 'Name 1',
'stop time' => '1:03 pm',
),
1 =>
array (
'order' => '2',
'stop name' => 'Name 2',
'stop time' => '2:03 pm',
),
2 =>
array (
'order' => '3',
'stop name' => 'Name 3',
'stop time' => '3:03 pm',
),
),
),
)
But I want to transform this array via PHP into a table that looks like this:
Name 1 | Name 2 | Name 3
------------------------------
7:03am | 8:03am | 9:03am
------------------------------
10:03am | | 11:03am
------------------------------
1:03pm | 2:03pm | 3:03pm
Basically, where there may be gaps based on the nested array's data. I can already construct a table as if there would be no gaps, but that creates issues, and the data I'm using based off of a database doesn't allow gaps to be inserted, so I need to know if there is an easy way with php and array commands to construct a table like this where the row names can be remembered and filled if there is a value, or passed over if there is not.

Name 1to be missing from trip #1 but present in trip #2?