I have searched the Forums and FAQ but haven't found a solution.
I hope this isn't a newbie question.
Quite simply, I am reading two values from an Oracle DB into variables.
They appear to be strings although I am not quoting the variables when the values are read into them. (Values are minus point 5 and minus point 6).
When I compare them, they give the wrong results. I thought the intval function would ensure they were converted to integer so should compare correctly.
For example :
$var1 = "-.5";
$var2 = "-.6";
$var3 = intval($var1);
$var4 = intval($var2);
if ($var3 > $var4 ) echo "$var1 is greater than $var2<br>";
else echo "$var1 is less than $var2<br>";
However, the result is : " -.5 is less than -.6 "
Isn't -.6 less than -.5?
This is making nonsense out of my Max and Min values.
Take the quotes away, and use $var1 and $var2 and it works fine.
TIA