常用的php对象类型判断

前端之家收集整理的这篇文章主要介绍了常用的php对象类型判断前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。



<a href="https://www.jb51.cc/tag/PHP/" target="_blank" class="keywords">PHP</a>常用的数值判断<a href="https://www.jb51.cc/tag/hanshu/" target="_blank" class="keywords">函数</a>


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


原文链接:https://www.f2er.com/php/29514.html

猜你在找的PHP相关文章