PHP code example of stereoflo / open-weather-map-api

1. Go to this page and download the library: Download stereoflo/open-weather-map-api 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/ */

    

stereoflo / open-weather-map-api example snippets


$city   = new City('Saint Petersburg, RU', 498817); // или буквенный указатель/или айди*
$url    = new Url('appId', Url::TYPE_WEATHER, $city);
$client = new Client();
$owm    = new OpenWeatherMap($client, $url);

var_dump($owm->getCount());
var_dump($owm->getStack());


$city   = new City('Saint Petersburg, RU', 498817); // или буквенный указатель/или айди*
$url    = new Url('appId', Url::TYPE_FORECAST5, $city);
$client = new Client();
$owm    = new OpenWeatherMap($client, $url);

var_dump($owm->getCount());
var_dump($owm->getStack());

$city   = new City('Saint Petersburg, RU', 498817); // или буквенный указатель/или айди*
$url    = new Url('appId', Url::TYPE_FORECAST16, $city);
$client = new Client();
$owm    = new OpenWeatherMap($client, $url);

var_dump($owm->getCount());
var_dump($owm->getStack());