Convert Kelvin to Celsius using PHP

Calculate by formula

<?php

function kelvinToCelsius(float $kelvin): float
{
    return $kelvin - 273.15;
}

$kelvin = 298.65;
$celsius = kelvinToCelsius($kelvin);

echo $celsius;

Leave a Comment

Cancel reply

Your email address will not be published.