php判断完整数,PHP的几个常用数字判断函数代码
生活随笔
收集整理的這篇文章主要介紹了
php判断完整数,PHP的几个常用数字判断函数代码
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
代碼如下:
常用的數(shù)值判斷函數(shù)//判斷數(shù)組
$colors = array("red", "blue", "green");
if(is_array($colors))
{
print("colors is an array"."
");
}
//雙精度數(shù)判斷
$Temperature = 15.23;
if(is_double($Temperature))
{
print("Temperature is a double"."
");
}
//整數(shù)判斷
$PageCount = 2234;
if(is_integer($PageCount))
{
print("$PageCount is an integer"."
");
}
//對(duì)象判斷
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"."
");
}
?>
總結(jié)
以上是生活随笔為你收集整理的php判断完整数,PHP的几个常用数字判断函数代码的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: php俩个字符串合并,php分割合并两个
- 下一篇: php文字超链接怎么写,php 文本UR