Convert Celsius to Kelvin using PHP

Calculate by formula

<?php

function celsiusToKelvin(float $celsius): float
{
    return $celsius + 273.15;
}

$celsius = 25.5;
$kelvin = celsiusToKelvin($celsius);

echo $kelvin;

Leave a Comment

Cancel reply

Your email address will not be published.