<?php $array = array( [ "unix" => 1556547761, // notice the two duplicate unix values "random" => 4 ], [ "unix" => 1556547761, "random" => 2 ], [ "unix" => 1556547769, "random" => 5 ], [ "unix" => 1556547765, // this should be in the 3rd position "random" => 9 ] ); function cmpByUnix($a, $b) { return $a["unix"] - $b["unix"]; } usort($array, "cmpByUnix"); print_r($array);
You have javascript disabled. You will not be able to edit any code.