I'd probably do it in Javascript so the page wouldn't have to be reloaded to see the answer, but simple math is pretty much the same either way, most or all of your Javascript should transfer with nothing more than adding dollar signs to the variables.
PHP Code:
function CtoF($C)
{
return $C * (9/5) + 32;
}
echo CtoF(100); // 212
Code:
function CtoF(C)
{
return C * (9/5) + 32;
}
document.getElementById('answer').innerHTML = CtoF(100); // 212