I am looking for an elegant way to turn this array:
Array ( [foo] => 1 [bar] => 1 [zim] => 3 [dib] => 6 [gir] => 1 [gaz] => 3 )
To this array:
Array ( [1] => Array ( foo, bar, gir ), [3] => Array ( zim, gaz ), [6] => Array ( dib ) )
Note. , there is no relationship between keys and values. They are completely arbitrary and are used only as examples. The resulting array must be an associative array, grouped by the values โโof the input array.
Thanks!
source share