PHP code example of zhmi / inflector
1. Go to this page and download the library: Download zhmi/inflector 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/ */
zhmi / inflector example snippets
$inflectorService = new \Zhmi\Inflector\Service('utf-8');
$inflections = $inflectorService->inflect('Дружба');
//Любой из этих вариантов будет верным
echo $inflections[1];
echo $inflections['родительный'];
echo $inflections['genitive'];
echo $inflections->getInflection(1);
echo $inflections->getInflection('родительный');
echo $inflections->getInflection('genitive');
echo $inflections->getGenitive();