My array contains the following:
Array ( [0] => Events - Central [1] => Central [2] => Finance [3] => 17 [5] => 11 [8] => 11 )
Array ( [0] => Events - Central [1] => Central [2] => HR [3] => 17 [5] => 11 [8] => 11 )
Array ( [0] => Events - Central [1] => Central [2] => IT [3] => 17 [5] => 11 [8] => 11 )
Array ( [0] => Events - Central [1] => London [2] => Sales [3] => 17 [5] => 11 [8] => 11 )
Array ( [0] => Events - Central [1] => London [2] => Marketing [3] => 17 [5] => 11 [8] => 11 )
Array ( [0] => Events - Central [1] => London [2] => HR [3] => 17 [5] => 11 [8] => 11 )
Array ( [0] => Piloting [1] => London [2] => HR [3] => 17 [5] => 11 [8] => 11 )
Array ( [0] => Piloting [1] => London [2] => IT [3] => 17 [5] => 11 [8] => 11 )
Now, using a simple WHILE loop allows me to loop through the array and I can easily extract the information I need but I'm struggling because I need to bring back distinct values (and I cannot change the SQL code).
The output would be a simple table like this, but notice that level 1 and 2 of the table are not repeated:
Events - Central 17
Central 17
Finance 11
HR 1
IT 1
London 28
Sales 17
Marketing 2
HR 5
Piloting 37
London 37
HR 30
IT 7
In short, I'm trying to bring back distinct instances - if that makes sense?
Is this even possible without deconstructing the array?
I'm very concious that I may not have illustrated/ framed this question well.