PHP code example of mesavolt / inflector

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

    

mesavolt / inflector example snippets


// Use it with any number or countable value:
Inflector::plural('cheval', 2);     // Returns 'chevaux'
Inflector::plural('cheval', 1);     // Returns 'chevaux'
Inflector::plural('cheval', [$horse1, $horse2]); // Returns 'chevaux'

// Specify the plural form if you want:
Inflector::plural('cheval', 2, 'chevals');     // Returns 'chevals'
Inflector::plural('un petit cheval', 2, 'des petits chevaux'); // Returns 'des petits chevaux'
bash
composer dump-autoload # make sure vendor/autoload.php exists
./vendor/bin/phpunit