<?php
array("date" => "2018-01-21", "count" => 1, "peopleCount"=> 2), array("date" => "2018-01-22", "count" => 1, "peopleCount"=> 3), array("date" => "2018-01-19", "count" => 1, "peopleCount"=> 4), array("date" => "2018-01-25", "count" => 1, "peopleCount"=> 5) );
usort($data, function($d1, $d2){ if ($t1 === $t2) return 0;
return ($t1 > $t2) ? -1 : 1;
});
PD9waHAKCiRkYXRhID0gYXJyYXkoCglhcnJheSgiZGF0ZSIgPT4gIjIwMTgtMDEtMjEiLCAiY291bnQiID0+IDEsICJwZW9wbGVDb3VudCI9PiAyKSwKCWFycmF5KCJkYXRlIiA9PiAiMjAxOC0wMS0yMiIsICJjb3VudCIgPT4gMSwgInBlb3BsZUNvdW50Ij0+IDMpLAoJYXJyYXkoImRhdGUiID0+ICIyMDE4LTAxLTE5IiwgImNvdW50IiA9PiAxLCAicGVvcGxlQ291bnQiPT4gNCksCglhcnJheSgiZGF0ZSIgPT4gIjIwMTgtMDEtMjUiLCAiY291bnQiID0+IDEsICJwZW9wbGVDb3VudCI9PiA1KQoJKTsKCQoKdXNvcnQoJGRhdGEsIGZ1bmN0aW9uKCRkMSwgJGQyKXsKCSR0MSA9IHN0cnRvdGltZSgkZDFbJ2RhdGUnXSk7CgkkdDIgPSBzdHJ0b3RpbWUoJGQyWydkYXRlJ10pOwoJaWYgKCR0MSA9PT0gJHQyKSByZXR1cm4gMDsKCXJldHVybiAoJHQxID4gJHQyKSA/IC0xIDogMTsKfSk7Cgp2YXJfZHVtcCgkZGF0YSk7