I want to compare two floats in php, below is a sample code
$a = 0.17;
$b = 0.17;
if($a == $b ){
echo 'a and b are same';
}
else {
echo 'a and b are not same';
}
In this code it return result of else condition instead of if condition ,even $a and $ b are same. Is there any special way to handle/compare float in php.
If yes then please help me to solve this issue.
Or there is problem with my server config.