I have the variable $peso
that oscillates between 1000 and 50000 (grams)
There is a freight table that I have as
1000a2000 => 10,00
2000a3000 => 20,00
...
9000a10000 => 100,00
kg_adicional => 2,25
I have ifs up to 10000 (grams), above that I should calculate the additional value, for example
$peso = 18000
I have to get the value of 9000a10000 ($ 100) and add another 8 KG, but I do not know how to break this variable and do the validation.