PHP code example of artemiso / transliterator

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

    

artemiso / transliterator example snippets




use Koff\Transliterator\Transliterator;
use Koff\Transliterator\Mapping\Lang;

// Initialize transliteration class
$ts = new Transliterator(Lang\RU\Scholarly::class);
echo $ts->toTranslit('Русский');                              // 'Russkij'

// Load another mapping
$ts->useMapping(Lang\SR\Scholarly::class);
echo $ts->toTrasnlit('Ниш');                                  // 'Niš'

// Temporary override mapping
echo $ts->toTrasnlit('Транслитерация', Lang\RU\Scholarly::class);   // 'Transliteracija'