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