php 转化整型需要注意的地方


public function tt(){

$num = '19.90';
echo $num;
echo '<br/>--------------<br/>';

echo 100 * $num;

echo '<br/>--------------<br/>';
echo (int)(100 * $num);

echo '<br/>--------------<br/>';
echo (string)(100 * $num);


echo '<br/>--------------<br/>';
echo (int)(string)(100 * $num);

}


19.90
--------------
1990
--------------
1989
--------------
1990
--------------
1990


原文地址:https://www.cnblogs.com/pansidong/p/11057827.html