PHP code example of randsonjs / inflect

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

    

randsonjs / inflect example snippets




use Inflect\Inflect

$inflector = new Inflect;

$inflector->pluralize('pão');            // pães
$inflector->pluralize('carro');          // carros

$inflector->singularize('carros');       // carro
$inflector->singularize('pães');         // pão

$inflector->camelize('tablename');       // TableName
$inflector->camelize('tablename', true); // tableName



use Inflect\Facade as Inflect; // Use facade to be able to do static calls

Inflect::pluralize('carro');          // carros
Inflect::singularize('carros');       // carro
Inflect::camelize('tablename');       // TableName