Convert Celsius to Fahrenheit using PHP

Calculate by formula

<?php

function celsiusToFahrenheit(float $celsius): float
{
    return $celsius * 1.8 + 32;
}

$celsius = 25.5;
$fahrenheit = celsiusToFahrenheit($celsius);

echo $fahrenheit;

Leave a Comment

Cancel reply

Your email address will not be published.