PHP Classes

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

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 263 All time: 7,781 This week: 45Up
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: 183518 in Sweden Sweden
Week rank: 200 Up2 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 (5)  
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 (5)  /  php  
File Role Description
Files folder imageclasses (1 file)
Files folder imagetraits (1 file)

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

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:263
This week:0
All time:7,781
This week:45Up