PHP Classes

PHP BMI Calculator: Calculate the body mass index of a person

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 260 All time: 7,794 This week: 82Up
Version License PHP version Categories
bmi-level-calculator 1.0.0GNU General Publi...5.4PHP 5, Biology
Description 

Author

This class can calculate the body mass index of a person.

It can take the height and weight of a person and computes the BMI value.

The class displays the resulting BMI value as the current script output.

Picture of Yerfry Ramirez
  Performance   Level  
Name: Yerfry Ramirez is available for providing paid consulting. Contact Yerfry Ramirez .
Classes: 7 packages by
Country: Sweden Sweden
Age: ???
All time rank: 184018 in Sweden Sweden
Week rank: 312 Up3 in Sweden Sweden Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php
if(isset($_GET['height'], $_GET['weight'], $_GET['calculate'])):
   
$height = $_GET['height'];
   
$Splitted = str_split($height);
    if(
count($Splitted) == 3):
       
$height = "{$Splitted[0]}.{$Splitted[1]}{$Splitted[2]}";
    endif;

    new
BMI($_GET['weight'], $height);
endif;
?>

<form method="GET" action="<?=$_SERVER['PHP_SELF'];?>">
Height:
<input type="text" name="height" value="" />
<br />
Weight:
<input type="text" name="weight" value="" />
<br />
<button type="submit" name="calculate">Submit</button>
</form>

<br/>
<hr>
Below 18.5 Underweight<br/>
18.5 – 24.9 Normal or Healthy Weight<br/>
25.0 – 29.9 Overweight<br/>
30.0 and Above Obese


Details

BMI-Level-Calculator


  Files folder image Files  
File Role Description
Files folder imagephp (2 directories)
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. Auxiliary data
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  php  
File Role Description
Files folder imageclasses (1 file)
Files folder imagetraits (1 file)

  Files folder image Files  /  php  /  classes  
File Role Description
  Plain text file BMI.php Class Class source

  Files folder image Files  /  php  /  traits  
File Role Description
  Plain text file trait.math.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:260
This week:0
All time:7,794
This week:82Up