PHP code example of vehsamrak / phpluralize

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

    

vehsamrak / phpluralize example snippets




use Vehsamrak\Phpluralize\Pluralizer;

$pluralizer = new Pluralizer();

$string = $pluralizer->pluralize(1, 'рубль', 'рубля', 'рублей'); // $string will be 'рубль' 
$string = $pluralizer->pluralize(2, 'рубль', 'рубля', 'рублей'); // $string will be 'рубля'
$string = $pluralizer->pluralize(5, 'рубль', 'рубля', 'рублей'); // $string will be 'рублей'
$string = $pluralizer->pluralize(21, 'рубль', 'рубля', 'рублей'); // $string will be 'рубль'