PHP code example of isfonzar / tdee-calculator

1. Go to this page and download the library: Download isfonzar/tdee-calculator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

isfonzar / tdee-calculator example snippets




lculations based on weight, height and age
use isfonzar\TDEECalculator\TDEECalculator;

$tdeeCalculator = new TDEECalculator();

echo $tdeeCalculator->calculate('male', 80, 182, 24);
echo "\n";

// ---------------------------------------------------------
// The unit is parametrizable
$options = [
    'formula' => 'revised_harris_benedict' // You can select the best formula for your needs
    'unit' => 'imperial', // Choose the desired measurement unit
];

$tdeeCalculator = new TDEECalculator($options);

echo $tdeeCalculator->calculate('male', 176, 6, 24);
echo "\n";

// Input activity level
echo $tdeeCalculator->calculate('male', 176, 6, 24, 'very_active');
echo "\n";

 // Calculations based on lean body mass
use isfonzar\TDEECalculator\LBMCalculator;

$options = [
    'unit' => 'metric',
];

$lbmCalculator = new LBMCalculator($options);
echo $lbmCalculator->calculate(80);
echo "\n";