Convert Kelvin to Fahrenheit using PHP

Calculate by formula

<?php

function kelvinToFahrenheit(float $kelvin): float
{
    return $kelvin * 1.8 - 459.67;
}

$kelvin = 298.65;
$fahrenheit = kelvinToFahrenheit($kelvin);

echo $fahrenheit;

Leave a Comment

Cancel reply

Your email address will not be published.