Well I have to do a 3-variable check with the following rule.
Variables:
$curva_a
$curva_b
$curva_c
Rules:
The variable $curva_a
always has to be greater than the others.
The variable $curva_b
must be less than $curva_a
and greater than $curva_c
.
The variable $curva_c
always has to be smaller than the others.
I made the code in php, but I did not like it very much, it's working, but I think there's a better way to do that.
Follow the code:
$erro = false;
// Verifica os valores das curvas
if (($curva_a < $curva_b) || ($curva_a < $curva_c)) {
$erro = true;
}
if (($curva_c > $curva_a) || ($curva_b < $curva_c)) {
$erro = true;
}
if ($curva_c > $curva_a) {
$erro = true;
}
// Verifica erro
if ($erro === true) {
echo "erro";
}