php example code : is_int function in php
is-int-php-example.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>php example code : is_int function in php</title>
</head>
<body>
<h3>php example code : is_int function in php</h3>
<?php
/*
----------------------------------------------------------------------------
let us make an integer number and test it wheather it is integer or not
by using php is_int function
----------------------------------------------------------------------------
*/
$myInteger = 999;
$intFlag = is_int($myInteger);
if($intFlag == true)
{
echo 'it is an integer number';
}
else
{
echo 'it is not an integer number';
}
echo "<br><br>";
/*
----------------------------------------------------------------------------
let us make an non integer number and test it wheather it is integer or not
by using php is_int function
----------------------------------------------------------------------------
*/
$myInteger = 999.99;
$intFlag = is_int($myInteger);
if($intFlag == true)
{
echo 'it is an integer number';
}
else
{
echo 'it is not an integer number';
}
?>
</body>
</html>

No comments:
Post a Comment
leave your comments here..