PHP code example of snowmannunu / weather
1. Go to this page and download the library: Download snowmannunu/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/ */
snowmannunu / weather example snippets
use SnowmanNunu\Weather\Weather;
$key = 'your key';
$weather = new Weather($key);
$response = $weather->getLiveWeather('深圳');
$response = $weather->getForecastsWeather('深圳');
'weather' => [
'key' => env('WEATHER_API_KEY'),
],
WEATHER_API_KEY=your key