php类型

获取变量类型

$num=2212.222;
echo gettype($num);

 

判断变量类型

if(is_integer($num)){
    echo "yes";
}else{
    echo "no";
}

 

数据类型转换

$num="22";
$num=(integer)$num;
echo $num;

posted @ 2017-11-15 19:52  会玩代码的摄影师  阅读(133)  评论(0编辑  收藏  举报