PHP code example of j-crowe / open-weather
1. Go to this page and download the library: Download j-crowe/open-weather 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/ */
j-crowe / open-weather example snippets
include_once 'vendor/autoload.php';
use JCrowe\OpenWeather\OpenWeather;
// Note the configs that are => 3
);
$appId = 'abcdefghijklmnop1234567890';
$openWeather = OpenWeather::getInstance($guzzleOpts, $baseUrl, $appId);
$response = $openWeather->getByCityName('los angeles');
if($response->isValid()) {
print_r($response->getWeatherData());
}