PHP code example of divineomega / php-languages

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

    

divineomega / php-languages example snippets


use \DivineOmega\Languages\Language;

$language = Language::getByName('German');
$language = Language::getByNativeName('Deutsch');
$language = Language::getByIso639_1('de');
$language = Language::getByIso639_2_t('deu');
$language = Language::getByIso639_2_b('ger');
$language = Language::getByIso639_3('deu');
$languages = Language::getByFamily('Indo-European');

echo $language->family;         // German
echo $language->name;           // Deutsch
echo $language->nativeName;     // de
echo $language->iso639_1;       // deu
echo $language->iso639_2_t;     // ger
echo $language->iso639_2_b;     // deu
echo $language->iso639_3;       // Indo-European
bash
composer