Here is an example of my data:
[204] => Array
(
[1] => Array
(
[leads] => 9
)
[2] => Array
(
[leads] => 15
)
)
[200] => Array
(
[1] => Array
(
[leads] => 7
)
[2] => Array
(
[leads] => 16
)
[3] => Array
(
[leads] => 5
)
)
I am at the stage where I trying to output the array data into a table but how do I set up the table headers dynamically so that the columns will be 1 | 2 | 3, even if some subsets don't have an array of that type?
The array is constructed from the results of a database query like so:
$dailytotals[$store][$campaigntypeid] = array('leads'=> $leads);
I tried a for each but just realised that it wouldn't work since not all subsets have all columns.
Is there a way to get what I am trying to find?