PHP code example of denismitr / translit

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

    

denismitr / translit example snippets


    $translit = new \Denismitr\Translit\Translit();

    $slug = $translit->transform("Строка для транслитерации, по правилам Яндекс!");
    //stroka-dlya-transliteracii-po-pravilam-yandeksa

$slug = (new \Denismitr\Translit\Translit)->transform("очень длинный текст...", 10);
// ochen-dlin

new \Denismitr\Translit\Translit(new YourTranslitStrategyImpl());