I did not dare to answer this question, or I should ask or not. I think this is a much more logical question. But I can’t figure it out.
I have an array that can include
$programFees = [100,200,100,500,800,800]
I can get the maximum value from this array with max($programFees). If I have 2 max values, for example 800,800, I want to take only one. I realized that php maxcan solve this problem.
But I want to sum the entire remaining amount from this array.
eg
$maxProgramFees = max($programFees);
//I got 800 and remaining amount is [100,200,100,500,800]
My total amount should be 1700. What approach should I use to get this amount?
source
share