I am facing some issue in multiple array to find height amount array.
I want to get the array that have high amount from multiple array to one new array in PHP.
If two or more arrays have same highest amount than get any array as new array.
Currently, I have two arrays having same amount but its not highest value so it will not select in the sample data.
The Output Array should be combined with the highest amount with its code and type.
Input:
(
[0] => Array
(
[code] => Custom discount
[amount] => 3514.55
[type] => fixed_amount
)
[1] => Array
(
[code] => MerOrder300
[amount] => 400.00
[type] => fixed_amount
)
[2] => Array
(
[code] => MerOrder400
[amount] => 400.00
[type] => fixed_amount
)
[3] => Array
(
[code] => MerOrder450
[amount] => 450.00
[type] => fixed_amount
)
)
Output:
(
[0] => Array
(
[code] => Custom discount
[amount] => 3514.55
[type] => fixed_amount
)
)