### Generate Weather Forecast Source: https://www.willyweather.com.au/info/api.html A PHP function to generate a weather forecast based on a random number. It defaults to 'rain' if the random number does not map to a predefined forecast. ```php public function generateForecast($random) { $forecasts = [ 1 => 'partly-cloudy', 2 => 'fine', 3 => 'sunny' ]; $response = 'rain'; // default if (isset($forecasts[$random])) { $response = $forecasts[$random]; } return $response; } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.