1. Go to this page and download the library: Download oblik/pluralization 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/ */
oblik / pluralization example snippets
namespace Oblik\Pluralization {
function place($n)
{
$class = LANGUAGES['en'];
$form = $class::getOrdinal($n);
switch ($form) {
case ONE: return "{$n}st";
case TWO: return "{$n}nd";
case FEW: return "{$n}rd";
case OTHER: return "{$n}th";
}
}
echo place(1); // 1st
echo place(2); // 2nd
echo place(103); // 103rd
echo place(14); // 14th
}