<?php $array = [ [ 'code' => 'Custom discount', 'amount' => 3514.55, 'type' => 'fixed_amount' ], [ 'code' => 'MerOrder300', 'amount' => 400.00, 'type' => 'fixed_amount' ], [ 'code' => 'MerOrder400', 'amount' => 3514.55, 'type' => 'fixed_amount' ], [ 'code' => 'MerOrder450', 'amount' => 450.00, 'type' => 'fixed_amount' ] ]; $max = max( array_column($array, 'amount') ); var_export( array_filter( $array, function($subarray) use ($max) { return $subarray['amount'] == $max; } ) );
You have javascript disabled. You will not be able to edit any code.