Given the temperature in degrees Centigrade, compute the equivilant Fahrenheit value.
<? // generate a random number, this will be the temperature in degrees centigrade $centigrade = mt_rand(1, 100); // this is the way to convert centigrade to fahrenheit $fahrenheit = ($centigrade * 1.8) + 32; // show the randomly generate centigrade and the fahrenheit equivilant echo $centigrade . ' degrees Centigrade is ' . round($fahrenheit, 2) . ' degrees Fahrenheit'; ?>Which produces:
39 degrees Centigrade is 102.2 degrees Fahrenheit