PHP code example of cristianoc72 / pluralizer

1. Go to this page and download the library: Download cristianoc72/pluralizer 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/ */

    

cristianoc72 / pluralizer example snippets


$pluralizer = new cristianoc72\Pluralizer();

var_dump($pluralizer->isPlural('Author'); // (bool) false

var_dump($pluralizer->isPlural('Books'));  // (bool) true
 php
$pluralizer = new cristianoc72\Pluralizer();

$plural = $pluralizer->getPluralForm('Author');
echo $plural; // Authors

$singular = $pluralizer->getSingularForm('Books');
echo $singular; // Book
 php
$pluralizer = new cristianoc72\Pluralizer();

$plural = $pluralizer->getPluralForm('tooth');
echo $plural; // teeth