In this PHP exercise, you will create an array of temperatures. Choose a spring month to have a wider range of temperatures to handle. We'll use 30 days of the month. The exercise is generic, but feel free to use a specific month in your own script. The answer script will use the Fahrenheit scale, but again feel free to use Celsius if you prefer.
Create your array of 30 high temperatures, approximating the weather for a spring month, then find the average high temp, the five warmest high temps and the five coolest high temps. Print your findings to the browser.
Hint: the HTML character entity for the degree sign is °.
Feel free to make up the temps or gather data for your own area. Here's a list of thirty Fahrenheit high temperatures you can use if you like:
68, 70, 72, 58, 60, 79, 82, 73, 75, 77, 73, 58, 63, 79, 78,
68, 72, 73, 80, 79, 68, 72, 75, 77, 73, 78, 82, 85, 89, 83
Here's the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"