I have a multidimesional array like this:
Array
(
[0] => Array
(
[ID] => 1
[date_start] => 2016-07-30
[customerID] => 15
[job_type] => service
)
[1] => Array
(
[ID] => 2
[date_start] => 2016-08-10
[customerID] => 12
[job_type] => service
)
[2] => Array
(
[ID] => 3
[date_start] => 2016-08-20
[customerID] => 15
[job_type] => service
)
etc
I would like to sort the data, so that it displays in "date_start" order, but keeping the customerID together.
So, in the above code, if I sort by date_start, it would put them in the order of:
ID - 1,2,3.
However, I want to keep the customer ID's together, but still sorting by date_start. Therefore, I want the order to be:
ID - 1,3,2
So, in essence, I need it to group the customers, find the earliest date for that customer, and sort by this earliest date.
Is this possible?
Thanks