PHP code example of satmaxt / clther
1. Go to this page and download the library: Download satmaxt/clther 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/ */
satmaxt / clther example snippets
// mode (DEVELOPMENT OR PRODUCTION)
$constant['SYSTEM_MODE'] = 'PRODUCTION';
// latitude longitude Bandung City
$constant['LATITUDE'] = -6.9042112;
$constant['LONGITUDE'] = 107.5882227;
// Units (Metric = Celcius, Imperial = Fahrenheit, Default = Kelvin)
$constant['UNITS'] = 'metric';
// system constant
$constant['PRODUCTION_API_URL'] = 'https://api.openweathermap.org';
$constant['DEVELOPMENT_API_URL'] = 'https://samples.openweathermap.org';
$constant['PRODUCTION_APP_ID'] = 'yourapikey';
$constant['DEVELOPMENT_APP_ID'] = 'b6907d289e10d714a6e88b30761fae22';
$constant['CONSTANT_PATH'] = __DIR__ . '/constant.php'; // custom constant file
$constant['SYSTEM_PATH'] = __DIR__ . '/cache/weather.dat'; // cache file name