- print_r: documentation ( source)
- krsort: documentation ( source)
<?php
$myArray = [
'person_1@gmail.com' => [
'2017-01-05' =>[
'this is line one',
'this is line two',
],
'2016-05-05' => [
'this is another line',
'and this is a fourth line'
],
'2017-07-10' => [
'more lines',
'yet another line'
],
],
'person_2@gmail.com' => [
'2015-01-01' => ['line for person_2'],
]
];
foreach($myArray as $key=>$value){
krsort($myArray[$key]);
}
print_r($myArray);