fyre/inflector

An inflection library.

v2.0.7 2024-06-29 01:50 UTC

This package is auto-updated.

Last update: 2024-08-29 02:14:58 UTC


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);