How do I sort a multidimensional hash array by a key maybe three levels in, in PHP?
- by Chris Denman
I am moving from Perl to PHP and am struggling to get my head around PHP sorting.
Here's what I have in Perl:
$log{12345}{0}{20100102}{name}='blah';
$log{54312}{1}{20100101}{name}='blah';
$log{14323}{3}{20100103}{name}='blah';
foreach $entry (sort {$log{$cook}{$a}{time} cmp $log{$cook}{$b}{time}} keys %{$log{$cook}}){
       ...
       }
Basically, I would have the same array structure in PHP but want to sort like I do above.