PHP code example of gulch / transliterato

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

    

gulch / transliterato example snippets


use gulch\Transliterato\Processor;
use gulch\Transliterato\Scheme\UkrToEngKeyboardLayout;

$processor = new Processor(new UkrToEngKeyboardLayout());
echo $processor->process('Руддщ цщкдв!'); // Hello world!

use gulch\Transliterato\BatchProcessor;
use gulch\Transliterato\Scheme\UkrToEngKeyboardLayout;
use gulch\Transliterato\Scheme\UkrToRusKeyboardLayout;

$processor = new BatchProcessor(
    new UkrToEngKeyboardLayout(),
    new UkrToRusKeyboardLayout()
);
$result = $processor->process('Руддщ фдд еру цщкдві!');
var_export($result); // array (0 => 'Hello all the worlds!', 1 => 'Руддщ фдд еру цщкдвы!',)

use gulch\Transliterato\Processor;
use gulch\Transliterato\Scheme\CyrToLatinTranslit;

$processor = new Processor(new CyrToLatinTranslit());
echo $processor->process('простий приклад'); //prostiy priklad