fyre / inflector
An inflection library.
v2.0.7
2024-06-29 01:50 UTC
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.59
- fyre/php-cs-fixer-config: ^1.0
- phpunit/phpunit: ^10
README
FyreInflector is a free, open-source inflection library for PHP.
Table Of Contents
Installation
Using Composer
composer require fyre/inflector
In PHP:
use Fyre\Utility\Inflector;
Methods
Inflect
Inflect a word based on a count.
$word
is a string representing the word.$count
is a number representing the count.
$inflected = Inflector::inflect($word, $count);
Pluralize
Get the plural form of a word.
$word
is a string representing the word.
$plural = Inflector::pluralize($word);
Singularize
Get the singular form of a word.
$word
is a string representing the word.
$singular = Inflector::singularize($word);