加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PHP的几个常用数字判断函数代码

发布时间:2020-12-13 06:06:21 所属栏目:PHP教程 来源:网络整理
导读:div class="codetitle" a style="CURSOR: pointer" data="6800" class="copybut" id="copybut6800" onclick="doCopy('code6800')" 代码如下: div class="codebody" id="code6800" 常用的数值判断函数 ? //判断数组 $colors = array("red","blue","green"); i

<div class="codetitle"><a style="CURSOR: pointer" data="6800" class="copybut" id="copybut6800" onclick="doCopy('code6800')"> 代码如下:<div class="codebody" id="code6800">


常用的数值判断函数


<?
//判断数组
$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"."
");
}
?>


(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读