唐山网站建设

设为主页 加入收藏 繁體中文

PHP实例:常常使用的数值判定函数

核心提示:PHP实例:常常使用的数值判定函数

 

以下为援用的内容:



常常使用的数值判定函数


//判定数组
$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://www.fw8.net/


TAG:函数,数组,数值,整数,精度
评论加载中...
内容:
评论者: 验证码: