PHP code example of swuppio / ru-ending

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

    

swuppio / ru-ending example snippets


get(int $number, array $words = ['Друг', 'Друга', 'Друзей']): array

echo Ending::get(5, ['Полис', 'Полиса', 'Полисов']); // Полисов

$words = ['Полис', 'Полиса', 'Полисов'];

$ending = new Ending($words);
echo $ending->formatByNumber(3); // Полиса