php example code : is float function in php

php example code : is_float function in php

is-float-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_float function in php</title>
 </head>
 <body>
  <h3>php example code : is_float function in php</h3>
  <?php
   /*
    -------------------------------------------------
    let us make a float number and test it wheather it is float or not
    by using php is_float function
    -------------------------------------------------
   */
   $myNumber = 99.99;
   
   $floatFlag = is_float($myNumber);
   
   if($floatFlag == true)
   {
    echo 'it is a float number';
   }
   else
   {
    echo 'it is not a float number';
   }
  ?>
 </body>
</html>


php example code : is_float function in php - output in the browser

No comments:

Post a Comment

leave your comments here..