PHP code example of fawno / un-m49

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

    

fawno / un-m49 example snippets


use UN\M49\English\ISOalpha3Names as ISOalpha3NamesEnglish;
use UN\M49\Spanish\ISOalpha3Names as ISOalpha3NamesSpanish;
use UN\M49\French\ISOalpha3Names as ISOalpha3NamesFrench;
use UN\M49\Russian\ISOalpha3Names as ISOalpha3NamesRussian;
use UN\M49\Chinese\ISOalpha3Names as ISOalpha3NamesChinese;
use UN\M49\Arabic\ISOalpha3Names as ISOalpha3NamesArabic;
use UN\M49\ISOalpha3;

// Get ISO-alpha3 code from M49 code
echo ISOalpha3::fromM49(724), PHP_EOL;

// Get English name from M49 code
echo ISOalpha3NamesEnglish::fromM49(724), PHP_EOL;

// Get Spanish name from M49 code
echo ISOalpha3NamesSpanish::fromM49(724), PHP_EOL;

// Get French name from M49 code
echo ISOalpha3NamesFrench::fromM49(724), PHP_EOL;

// Get Russian name from M49 code
echo ISOalpha3NamesRussian::fromM49(724), PHP_EOL;

// Get Chinese name from M49 code
echo ISOalpha3NamesChinese::fromM49(724), PHP_EOL;

// Get Arabic name from M49 code
echo ISOalpha3NamesArabic::fromM49(724), PHP_EOL;