PHP数字判断函数

 
更多

PHP的几个常用数字判断函数代码,主要包括双精度,整数,字符判断等。

<HTML> 
<HEAD> 
<TITLE>常用的数值判断函数</TITLE> 
</HEAD> 
<BODY> 
<? 
//判断数组 
$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>"); 
} 
?> 
</BODY> 
</HTML>
打赏

本文固定链接: https://www.cxy163.net/archives/4667 | 绝缘体

该日志由 绝缘体.. 于 2013年05月23日 发表在 未分类 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: PHP数字判断函数 | 绝缘体
关键字: , , , ,

PHP数字判断函数:等您坐沙发呢!

发表评论


快捷键:Ctrl+Enter