1. Go to this page and download the library: Download reynevan/imgw-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/ */
reynevan / imgw-php example snippets
use Reynevan\Imgw\ImgwClient;
$client = new ImgwClient();
foreach ($client->synop()->getWeatherStations() as $station) {
printf(
"%s: %.1f°C\n",
$station->getName(),
$station->getTemperature()
);
}
use Reynevan\Imgw\Http\HttpClientInterface;
use Reynevan\Imgw\Http\PsrHttpClientAdapter;
use Reynevan\Imgw\ImgwClient;
$httpClient = new PsrHttpClientAdapter($myPsr18Client, $myPsr17RequestFactory);
$client = new ImgwClient($httpClient);
use Reynevan\Imgw\Exceptions\ImgwApiException;
try {
$station = $client->synop()->getWeatherStationById(999999);
} catch (ImgwApiException $e) {
// e.g. the station doesn't exist or the API is unavailable
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.