PHP code example of owenandrews / willyweather-php
1. Go to this page and download the library: Download owenandrews/willyweather-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
owenandrews / willyweather-php example snippets
use WillyWeather\Client;
$willyWeather = new Client('<API-KEY>');
$sydney = $willyWeather->location(4950);
$sydney->getName();
use WillyWeather\Client;
$willyWeather = new Client('<API-KEY>');
$sydney = $willyWeather->location(4950);
$sydney->getForecasts();
$sydney->getObservational();
use WillyWeather\Client;
$willyWeather = new Client('<API-KEY>');
$sydney = $willyWeather->location(4950);
$sydney->getForecasts(["forecasts" => ["temperature", "wind", "rainfallprobability"], "days" => 3]);