PHP的几个常用数字判断函数代码,主要包括双精度,整数,字符判断等。
/**
* 几个常用数字判断函数代码
*
* @param
* @arrange 512-笔记网: www.www.jb51.cc
**/
$colors = array("red","blue","green");
if(is_array($colors))
{
print("colors is an array"."<br>");
}
//双精度数判断
$Temperature = 15.23;
if(is_double($Temperature))
{
print("Temperature is a double"."<br>");
}
//整数判断
$PageCount = 2234;
if(is_integer($PageCount))
{
print("$PageCount is an integer"."<br>");
}
//对象判断
class widget
{
var $name;
var $length;
}
$thing = new widget;
if(is_object($thing))
{
print("thing is an object"."<br>");
}
//字符判断
$Greeting = "Hello";
if(is_string($Greeting))
{
print("Greeting is a string"."<br>");
}
/*** 来自编程之家 jb51.cc(jb51.cc) ***/
原文链接:https://www.f2er.com/php/528050.html