3v4l.org

run code in 300+ PHP versions simultaneously
<?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; } ) );

preferences:
59.43 ms | 1530 KiB | 5 Q