PHP code example of rhdevelopment / inflecta

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

    

rhdevelopment / inflecta example snippets




use Ryan\Inflecta\Inflecta;

Inflecta::toCamelCase('user_profile');          // userProfile
Inflecta::toPascalCase('user profile');         // UserProfile
Inflecta::toSnakeCase('HTTPResponseCode');      // http_response_code
Inflecta::toKebabCase('makeItSo');              // make-it-so
Inflecta::toTitleCase('customer_id');           // Customer Id
Inflecta::toConstantCase('statusFlag');         // STATUS_FLAG

Inflecta::pluralize('category');                // categories
Inflecta::singularize('boxes');                 // box
Inflecta::humanize('apiClient');                // Api client
Inflecta::slugify('Hello, World!');             // hello-world
Inflecta::classify('order_items');              // OrderItem
Inflecta::tableize('OrderItem');                // order_items
bash
php examples/demo.php