较长数字 字符串 的比较问题
本帖最后由 anyilaoliu 于 2013-12-13 15:04:43 编辑 如题
遇到这样的问题
$a = "222111565652521142";
$b = "222111565652521139";
$c = 222111565652521142;
$d = 222111565652521139;
var_dump($a);
echo "<br/>";
var_dump($b);
echo "<br/>";
var_dump($c);
echo "<br/>";
var_dump($d);
echo "<br/>";
if ($a == $b) {
echo 3;
}else{
echo 31;
}
echo "<br/>";
if ($c == $d) {
echo 4;
}else{
echo 41;
}
echo "<br/>";
string '222111565652521142' (length=18)
string '222111565652521139' (length=18)
float 2.2211156565252E+17
float 2.2211156565252E+17
31
4