php 判断是什么类型,php 类型判断
//判断数组 $colors = array("red"php判断, "blue", "green"); if(is_array($colors)) { echo("colors is an array"."
"); } //双精度数判断 $Temperature = 15.23; if(is_doubl
学习笔记 //判断数组 $colors = array("red"php判断, "blue", "green"); if(is_array($colors)) { echo("colors is an array"." "); } //双精度数判断 $Temperature = 15.23; if(is_double($Temperature)) { echo("$Temperature is a double"." "); } //整数判断 $PageCount = 2234; if(is_integer($PageCount)) { echo("$PageCount is an integer"." "); } //对象判断 class widget { var $name; var $length; } $thing = new widget; if(is_object($thing)) { echo("thing is an object"." "); } //字符判断 $Greeting = "Hello"; if(is_string($Greeting)) { echo("$Greeting is a string"." "); } //数字判断 $Num=1002; if(is_int($Num)){ echo("$Num is a int"." "); } ?> (编辑:成都站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |