PHP code example of estasi / filter

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

    

estasi / filter example snippets




declare(strict_types=1);

use Estasi\Filter\CamelCase;

$filter = new CamelCase();

echo $filter->filter('camel case'); // camelCase
// or 
echo $filter('camel_case'); // camelCase



declare(strict_types=1);

use Estasi\Filter\{Chain,Trim};

$string = ' camel case string   ';

$chain = new Chain(Chain::DEFAULT_PLUGIN_MANAGER, 'trim', 'camelCase');

// the same thing
$chain = new Chain();
$chain = $chain->attach(new Trim())
               ->attach([Chain::FILTER_NAME => 'camelCase']); // or attach('camelCase')

echo $chain->filter($string); // "camelCaseString"