Home > Backend Development > PHP Tutorial > http://67.220.92.14/forum/inde Several common number judgment function codes in PHP

http://67.220.92.14/forum/inde Several common number judgment function codes in PHP

WBOY
Release: 2016-07-29 08:48:30
Original
1564 people have browsed it

Copy the code The code is as follows:




Commonly used numerical judgment functions


< ;?
//Judge array
$colors = array("red", "blue", "green");
if(is_array($colors))
{
print("colors is an array"."< br>");
}
//Double precision number judgment
$Temperature = 15.23;
if(is_double($Temperature))
{
print("Temperature is a double"."
");
}
//Integer judgment
$PageCount = 2234;
if(is_integer($PageCount))
{
print("$PageCount is an integer"."
");
}
//Object judgment
class widget
{
var $name;
var $length;
}
$thing = new widget;
if(is_object($thing))
{
print("thing is an object"."
" );
}
//Character judgment
$Greeting = "Hello";
if(is_string($Greeting))
{
print("Greeting is a string"."
");
}
? >


The above introduces http://67.220.92.14/forum/inde several common number judgment function codes of PHP, including the content of http://67.220.92.14/forum/inde. I hope friends are interested in PHP tutorials. Helps.

Related labels:
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