PHP code example of epochblue / darksky-php

1. Go to this page and download the library: Download epochblue/darksky-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/ */

    

epochblue / darksky-php example snippets



// Creates an instance of the API wrapper.
$darksky = new DarkSky('<YOUR API KEY HERE>');

// Returns a forecast for the next hour at a specific location
$forecast = $darksky->getForecast(36.126617, -86.842756);

// Returns a (slightly more brief) forecast for the next hour at a specific location
$brief_forecast = $darksky->getBriefForecast(36.126617, -86.842756);

// Returns forecasts for given locations at specific points in time
// NOTE: the 'time' array key is optional. If it's not 
json
{
    "pochblue/darksky-php": "dev-master"
    }
}