PHP code example of oihana / php-standards

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

    

oihana / php-standards example snippets


use org\iso\ISO4217;
use org\iso\ISO6391;

$usd = ISO4217::USD; // 'USD'
$en  = ISO6391::EN;  // 'en'

use org\iso\ISO4217;

ISO4217::validate('EUR');             // OK
$isValid = ISO4217::ums();          // ['AED', 'AFN', ...]

use org\unece\uncefact\MeasureCode;
use org\unece\uncefact\MeasureName;
use org\unece\uncefact\MeasureSymbol;

$code   = MeasureCode::KILOGRAM;        // 'KGM'
$name   = MeasureCode::getName($code);  // 'Kilogram'
$symbol = MeasureCode::getSymbol($code);// 'kg'

// Reverse lookups
$fromName   = MeasureCode::getFromName('Kilogram'); // 'KGM'
$fromSymbol = MeasureCode::getFromSymbol('kg');     // 'KGM'

use org\unece\uncefact\PackageCode;
use org\unece\uncefact\PackageName;

$bx   = PackageCode::BOX;            // 'BX'
$name = PackageCode::getName($bx);   // 'Box'
$code = PackageName::getCode('Box'); // 'BX'

use org\unstats\UNM49;

$fr = UNM49::FRA; // 'FRA'
bash
composer