Код: Выделить всё
$MyArray = [
[ "13 March 2012" => "Commandes Anticorps et Kits 2012" ],
[ "4 May 2012" => "Prix de la Chancellerie" ],
[ "17 April 2012" => "MàJ antivirus Kapersky" ],
[ "14 May 2012" => "Atelier Formation INSERM" ],
[ "14 March 2012" => "Webzine AP-HP" ],
[ "11 April 2011" => "Nouvelle Charte des Publications" ],
[ "23 April 2012" => "BiblioINSERM: Nouveaux Codes" ],
[ "7 March 2012" => "Springer : Protocols également en test" ],
[ "4 October 2011" => "[info.biblioinserm] Archives des titres Springer" ],
];
Среди различных решений, которые я нашел, я попробовал следующее:
Код: Выделить всё
function date_compare($a, $b)
{
$t1 = strtotime($a['datetime']);
$t2 = strtotime($b['datetime']);
return $t1 - $t2;
}
Код: Выделить всё
usort($MyArray, 'date_compare');
Подробнее здесь: https://stackoverflow.com/questions/106 ... d-as-d-m-y