欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP的几个常用数字判断函数代码_PHP教程

程序员文章站 2022-04-06 12:22:46
...
复制代码 代码如下:



常用的数值判断函数



//判断数组
$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"."
");
}
?>


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/325323.htmlTechArticle复制代码 代码如下: HTML HEAD TITLE常用的数值判断函数/TITLE /HEAD BODY ? //判断数组 $colors = array("red", "blue", "green"); if(is_array($colors)) { print("colo...