Home > Backend Development > PHP Tutorial > 常用的数值判断函数_PHP

常用的数值判断函数_PHP

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 12:30:19
Original
1021 people have browsed it



常用的数值判断函数



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


常用的数值判断函数
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template