<?php $array = [ ["2" => 6, "5" => 1], ["2" => 1, "5" => 3], ]; var_export( array_reduce( $array, fn($result, $row) => array_reduce( array_keys($row), fn($res, $k) => isset($res[$k]) && $res[$k] >= $row[$k] ? $res : array_replace($res, [$k => $row[$k]]), $result ), [] ) );
You have javascript disabled. You will not be able to edit any code.