I'm facing a great question in how to manage my array.
Array ( [0] => Array ( [0] => Rule [1] => 0,5 [2] => Name [3] => Task ) [1] => Array ( [0] => Another rule [1] => 2 [2] => name [3] => Task ) [2] => Array ( [0] => Rule [1] => 1 [2] => name [3] => Sub-Task ) [3] => Array ( [0] => Another rule [1] => 1 [2] => another name [3] => Sub-Task ) [4] => Array ( [0] => Rule [1] => 1 [2] => another name [3] => Task ) etc...
I need to aggregate (in another array) values for "name" and "task" just to have this view:
name -> task -> 10 -> rule
-> task -> 5 -> another rule
-> Sub Task -> 20 -> another rule
-> Sub task -> 0 -> rule
another name -> task -> 10 -> rule
-> task -> 5 -> another rule
-> Sub Task -> 20 -> another rule
-> Sub task -> 0 -> rule
It's a bit hard to do for me and I cannot figure out how to manage it.
I've tried array_map, several foreach with if condition inside, but nothing.
Can anybody help me?
Thanks