您当前的位置:首页 > 其他技术 > 网页技术

详细讲解PHP常用的数值判断函数

本文出处:网游动力作者:本站发布时间:2008-11-19阅读次数:
<HTML>bbV中国教程在线
<HEAD>bbV中国教程在线
<TITLE>常用的数值判断函数</TITLE>bbV中国教程在线
</HEAD>bbV中国教程在线
<BODY>bbV中国教程在线
<?bbV中国教程在线
//判断数组bbV中国教程在线
$colors = array("red", "blue", "green");bbV中国教程在线
if(is_array($colors))bbV中国教程在线
{bbV中国教程在线
print("colors is an array"."<br>");bbV中国教程在线
}bbV中国教程在线
//双精度数判断bbV中国教程在线
$Temperature = 15.23;bbV中国教程在线
if(is_double($Temperature))bbV中国教程在线
{bbV中国教程在线
print("Temperature is a double"."<br>");bbV中国教程在线
}bbV中国教程在线
//整数判断bbV中国教程在线
$PageCount = 2234;bbV中国教程在线
if(is_integer($PageCount))bbV中国教程在线
{bbV中国教程在线
print("$PageCount is an integer"."<br>");bbV中国教程在线
}bbV中国教程在线
//对象判断bbV中国教程在线
class widgetbbV中国教程在线
{bbV中国教程在线
var $name;bbV中国教程在线
var $length;bbV中国教程在线
}bbV中国教程在线
$thing = new widget;bbV中国教程在线
if(is_object($thing))bbV中国教程在线
{bbV中国教程在线
print("thing is an object"."<br>");bbV中国教程在线
}bbV中国教程在线
//字符判断bbV中国教程在线
$Greeting = "Hello";bbV中国教程在线
if(is_string($Greeting))bbV中国教程在线
{bbV中国教程在线
print("Greeting is a string"."<br>");bbV中国教程在线
}bbV中国教程在线
?>bbV中国教程在线
</BODY>bbV中国教程在线
</HTML>