pluralize
A simple PHP lib to turn words into their plural form. Based on the rules from Rails pluralize., (*1)
Install via composer
Installation of pluralize is through composer., (*2)
To get started quickly, run the following command, (*3)
composer require kevinkaske/pluralize
Usage
pluralize(single_string,number_int);
Example 1:
$balloon_number = 1;
echo 'You have '.$balloon_number.' '.pluralize('balloon',$balloon_number).'!';
Would output You have 1 balloon!, (*4)
Example 2:
$balloon_number = 2;
echo 'You have '.$balloon_number.' '.pluralize('balloon',$balloon_number).'!';
Would output You have 2 balloons!, (*5)