<?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);
Array
(
[person_1@gmail.com] => Array
(
[2017-07-10] => Array
(
[0] => more lines
[1] => yet another line
)
[2017-01-05] => Array
(
[0] => this is line one
[1] => this is line two
)
[2016-05-05] => Array
(
[0] => this is another line
[1] => and this is a fourth line
)
)
[person_2@gmail.com] => Array
(
[2015-01-01] => Array
(
[0] => line for person_2
)
)
)