php example code : is_double function in php
is-double-php-example.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"gt;
<html xmlns="http://www.w3.org/1999/xhtml"gt;
<headgt;
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /gt;
<titlegt;php example code : is_double function in php</titlegt;
</headgt;
<bodygt;
<h3gt;php example code : is_double function in php</h3gt;
<?php
/*
-------------------------------------------------
let us make a double number and test it wheather it is double or not
by using php is_double function
-------------------------------------------------
*/
$myNumber = 99999999999999999999999999999999999999.99;
$doubleFlag = is_double($myNumber);
if($doubleFlag == true)
{
echo 'it is a double number';
}
else
{
echo 'it is not a double number';
}
echo "<brgt;<brgt;";
/*
-------------------------------------------------
let us make a non double number and test it wheather it is double or not
by using php is_double function
-------------------------------------------------
*/
$myNumber = -1;
$doubleFlag = is_double($myNumber);
if($doubleFlag == true)
{
echo 'it is a double number';
}
else
{
echo "<h4 style='background:#888888; color:yellow;'gt;it is not a double number</h4gt;";
}
?gt;
</bodygt;
</htmlgt;

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