3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "0"=>array("0"=>"joe", "1"=>"2018-07-18 09:00:00"), "1"=>array("0"=>"tom", "1"=>"2018-07-17 09:00:00"), "2"=>array("0"=>"joe", "1"=>"2018-07-14 09:00:00"), "3"=>array("0"=>"sam", "1"=>"2018-07-19 09:00:00"), ); usort($arr, function($a, $b) { return $a[1] <=> $b[1]; }); $joes = array_intersect(array_column($arr, 0), ["joe"]); $current = max(array_keys($joes)); Unset($arr[$current]); Var_dump($arr);
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
array(3) { [0]=> array(2) { [0]=> string(3) "joe" [1]=> string(19) "2018-07-14 09:00:00" } [1]=> array(2) { [0]=> string(3) "tom" [1]=> string(19) "2018-07-17 09:00:00" } [3]=> array(2) { [0]=> string(3) "sam" [1]=> string(19) "2018-07-19 09:00:00" } }

preferences:
100.31 ms | 404 KiB | 165 Q