当前位置:Gxlcms >
PHP教程 >
http://67.220.92.14/forum/indePHP的几个常用数字判断函数代码
http://67.220.92.14/forum/indePHP的几个常用数字判断函数代码
时间:2021-07-01 10:21:17
帮助过:26人阅读
代码如下:
常用的数值判断函数 //判断数组
$colors = array("red", "blue", "green");
if(is_array($colors))
{
print("colors is an array"."
");
}
//双精度数判断
$Temperature = 15.23;
if(is_double($Temperature))
{
print("Temperature is a double"."
");
}
//整数判断
$PageCount = 2234;
if(is_integer($PageCount))
{
print("$PageCount is an integer"."
");
}
//对象判断
class widget
{
var $name;
var $length;
}
$thing = new widget;
if(is_object($thing))
{
print("thing is an object"."
");
}
//字符判断
$Greeting = "Hello";
if(is_string($Greeting))
{
print("Greeting is a string"."
");
}
?>
以上就介绍了http://67.220.92.14/forum/inde PHP的几个常用数字判断函数代码,包括了http://67.220.92.14/forum/inde方面的内容,希望对PHP教程有兴趣的朋友有所帮助。