1
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 bigger than the others.
The variable $curva_b
has to be smaller than the $curva_a
and greater than the $curva_c
.
The variable $curva_c
always has to be smaller than the others.
I did the code in php, but I didn’t like it much, it’s working, but I think there’s some better way to do it.
Follows 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";
}
if( ! ($curva_a > $curva_b > $curva_c) ){ /missed/ } It would solve already do not think ?
– Bartolomeu S. Gusella
@Bartolomeus.Gusella, PHP does not support this type of syntax.
– Woss