PHP code example of safran-cassiopee / php-metar-decoder
1. Go to this page and download the library: Download safran-cassiopee/php-metar-decoder 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/ */
safran-cassiopee / php-metar-decoder example snippets
// check that the $dew_point is not null and give it a default value if it is
$dew_point = $d->getDewPointTemperature();
if($dew_point == null){
$dew_point = new Value(999, Value::DEGREE_CELSIUS);
}
// $dew_point object can now be accessed safely
$dew_point->getValue();
$dew_point->getUnit();
$decoder = new MetarDecoder\MetarDecoder();
// change global parsing mode to "strict"
$decoder->setStrictParsing(true);
// this parsing will be made with strict mode
$decoder->parse("...");
// but this one will ignore global mode and will be made with not-strict mode anyway
$decoder->parseNotStrict("...");
// change global parsing mode to "not-strict"
$decoder->setStrictParsing(false);
// this parsing will be made with no-strict mode
$decoder->parse("...");
// but this one will ignore global mode and will be made with strict mode anyway
$decoder->parseStrict("...");