I basically want to find the key of the largest amount in the array that is lower than my value amount. So in this case 2 (which has a value of 6, the largest amount lower than 7).
If I could return an array with the keys of all lower values I could take the max value from that.
I’ll have two arrays of qualifying and discount amounts, both have exactly the same amount of values, probably around 4 or 5, all numeric.
I then want to check the current order amount to find the tier (i.e. the key) from the qualifying amounts array, and get the correct discount from the discount amounts array.