您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

常用的数值判断函数_PHP

2024/3/26 23:37:06发布24次查看
常用的数值判断函数
//判断数组
 $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.
);
 }
?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product