php数据类型转换
1)自动转换
<?php
$str_uname="124556"; //字符串类型
$a=$str_uname; //字符串类型
echo $a+1; //$a自动转成了整型
?>
输出结果:124557
2)(int)
3)settype()函数
settype(变量,要转成的数据类型) 例如: settype($var1,integer)
php数据类型转换
1)自动转换
<?php
$str_uname="124556"; //字符串类型
$a=$str_uname; //字符串类型
echo $a+1; //$a自动转成了整型
?>
输出结果:124557
2)(int)
3)settype()函数
settype(变量,要转成的数据类型) 例如: settype($var1,integer)