I am a bit confuse, I am having this problem with comparison operators which I can't think of the reason. Initially, i tot it was because I was using string type, then as I play around with the type, i realise, something else is wrong.
Running the code below on my pc return TRUE. $d > $c, where both are of the same type, and has a value of 5. Can someone please enlighten me?
$a = '8.80';
$b = '3.80';
$c = '5.00';
#settype($a, 'float');
#settype($b, 'float');
#settype($c, 'float');
$d = $a - $b;
if ($d > $c) {
print 'c = '.$c.' of type '.gettype($c).'<br>';
print 'd = '.$d.' of type '.gettype($d).'<br><br>';
print 'yes';
} else {
print 'c = '.$c.' of type '.gettype($c).'<br>';
print 'd = '.$d.' of type '.gettype($d).'<br><br>';
print 'no';
}