I want to try to merge and sort a multidimensional array. Currently the array looks like this:
Array
(
[0] => Array
(
[customerID] => 1234
[service] => Car
[CSA] => Jack
[status] => 3
)
[1] => Array
(
[customerID] => 1234
[service] => Cap
[CSA] => Jill
[status] => 3
)
[2] => Array
(
[customerID] => 1234456
[service] => Plate
[CSA] => Jack
[status] => 1
)
)
In this multidimensional array, The customerID will be unique, however, many second-level arrays feature the same customerID. Similarly, in these arrays, the CSA could be the same along with the status.
I want the end array to look as follows:
Array
(
[0] => Array
(
[customerID] => 1234
[service] => Car <br/> Cap
[CSA] => Jack <br /> Jill
[status] => 3
)
[2] => Array
(
[customerID] => 1234456
[service] => Plate
[CSA] => Jack
[status] => 1
)
)
Now, if the service is the same in a set where the customerID is the index, then it shouldn't be added to the value string. The same goes for everything else but the CustomerID.
How do I do this with PHP?