I have the following array:
Array
(
[Sir Ruane] => Array
(
[2018-07-03] => Array
(
[Product 1] => Array
(
[Paid] => Array
(
[Ticket] => Array
(
[Standard] => Array
(
[quantity] => 6
[asistance] => 6
)
)
)
)
)
[2018-07-01] => Array
(
[Product 1] => Array
(
[Paid] => Array
(
[Ticket] => Array
(
[Standard] => Array
(
[quantity] => 2
[asistance] => 2
)
)
)
)
)
[2018-07-06] => Array
(
[Product 1] => Array
(
[Paid] => Array
(
[Ticket] => Array
(
[Standard] => Array
(
[quantity] => 5
[asistance] => 5
)
)
)
)
)
)
)
I'm triying to order the array by the key with a date format as they're are printed in date order ascending.
Like this:
Customer name -> Date (ordered descending) -> Product -> Status -> etc.
I tried the following because I've read it in another post in the Stackoverflow community:
array_multisort( array_column($array, $array[0][0]), SORT_ASC, $array );
But this gave me the array that I wrote first.
I also tried other functions like ksort(), sort(), usort() but nothing does what I'm trying to achieve.
I've also read that sort() function can have a custom function to order things but all examples I've read are column name based and I don't have a column name as keys are always variable depending on user name, date, product name, status, ticket type and ticket name.
Can anyone help me to do this?