1. Go to this page and download the library: Download ralphschindler/calcdown 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/ */
100 cm in m // 1 (m)
20 ml in teaspoons // "4.05" (tsp)
50 cm in inches // 50 (inches)
today + 7 days // "2025-11-09" (date)
today + 30 days // "2025-12-02" (date)
price = $8 times 3 // Assign $24 to price
tax = price * 8.5% // Use price variable
total = price + tax // "25.02" (USD approx)
100 + 20% // 120
200 - 15% // 170
20% of what is 50 // 250 (reverse percentage)
// Combining multiple features
base = $299 times 1
discount = base - 25%
tax = discount + 8.5%
final = tax in EUR // Approx "207.06" (EUR)
// Construction calculations
length = 25 cm * 6
buffered = length + 5%
meters = buffered in m // 1.58 (m)
2 + 2 # This is a comment
# Lines starting with # are ignored
price = $100 # inline comments work too
$block->toArray(); // Returns array of line results
$block->finalLine(); // Returns last LineEvaluation or null
$block->lines; // Array of all LineEvaluation objects
$timeline = <<<CALC
project_start = today
design_phase = project_start + 14 days
development_phase = design_phase + 30 days
testing_phase = development_phase + 10 days
launch_date = testing_phase + 7 days
CALC;
$result = $parser->parseBlock($timeline);
$launch = $result->finalLine();
$conversions = <<<CALC
recipe_ml = 250 ml
in_teaspoons = recipe_ml in teaspoons
width_cm = 150 cm
width_m = width_cm in m
CALC;
$result = $parser->parseBlock($conversions);
$finance = <<<CALC
income = $5000 times 1
expenses = income - 30%
savings = income * 20%
remaining = expenses - savings
euros = remaining in EUR
CALC;
$result = $parser->parseBlock($finance);