PHP code example of rugaard / dmi

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

    

rugaard / dmi example snippets


'providers' => [
    Rugaard\DMI\Providers\Laravel\ServiceProvider::class,
]

# Instantiate the DMI client.
$dmi = new \Rugaard\DMI\DMI;

# National forecast.
$forecast = $dmi->forecast();

# Location by coordinate.
$location = $dmi->locationByCoordinate(55.67594, 12.56553);

# National warnings.
$warnings = $dmi->warnings();

new DMI(?int $defaultLocationId, ?Client $httpClient);

forecast();

extendedForecast();

search(string $query, int $limit);

location(?int $locationId, bool $

locationByCoordinate(float $latitude, float $longitude, bool $

warnings();

sunTimes(?int $locationId);

uv(?int $locationId);

pollen();

seaStations(bool $withObservations, bool $withForecast);

seaStation(int $stationId, bool $withObservations, bool $withForecast);

archive(string $measurement, string $frequency, $period, ?int $municipalityId, string $country);