Find min/max in a two dimensional array

Here’s one way to get the min and max values: $min = min(array_column($array, ‘Price’)); $max = max(array_column($array, ‘Price’)); To return the nested array for the min and max: $prices = array_column($array, ‘Price’); $min_array = $array[array_search(min($prices), $prices)]; $max_array = $array[array_search(max($prices), $prices)]; You could do each in one line since that looked like what you were trying … Read more