13
I’m trying to use the function max
, but I can’t hit.
// variáveis da diferença salarial
$saldev[0] = $_POST ["Tdate5"];
$saldev[1] = $_POST ["Tdate9"];
$saldev[2] = $_POST ["Tdate13"];
$saldev[3] = $_POST ["Tdate17"];
$saldev[4] = $_POST ["Tdate21"];
$saldev2 = max($saldev);
(Note: The above code works the way it is. Due to a inexplicable error I received some wrong outputs and created the question, and from some tips I found that it was working (ok, it’s confusing, but what matters is that it’s working). The hypothesis with ksort
also works for the same purpose, so I chose it as solved)
But the exit from var_dump
of $saldev
after sending the form with the completed fields, is:
array(5) { [0]=> string(0) "" 1=> string(0) "" [2]=> string(0) "" [3]=> string(0) "" [4]=> string(0) "" }
And that of $saldev2
is:
string(0) ""
The HTML of form is within a large table, I will include one of the fields input
(everyone is like that):
<label for="Cvpos5"></label>
<input type="text" id="Cvpos5" name="Tdate5" size="10" class="preco">