详细讲解PHP常用的数值判断函数
<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>
<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>
- 上一篇文章:巧妙运用ASP实现在线压缩与解压缩
- 下一篇文章:PHP和JS实现普通HTTP上安全地传输密码
热门文章
热门标签