|
<HTML>
<HEAD>
<TITLE>php常用的數(shù)值判斷函數(shù)</TITLE>
</HEAD>
<BODY>
<?
//判斷數(shù)組
$colors = array("red", "blue", "green");
if(is_array($colors))
{
print("colors is an array"."<br>");
}
//雙精度數(shù)判斷
$Temperature = 15.23;
if(is_double($Temperature))
{
print("Temperature is a double"."<br>");
}
//整數(shù)判斷
$PageCount = 2234;
if(is_integer($PageCount))
{
print("$PageCount is an integer"."<br>");
}
//對(duì)象判斷
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>
php技術(shù):常用的php對(duì)象類(lèi)型判斷,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。