PHP code example of allansun / camel

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

    

allansun / camel example snippets




amel\CaseTransformer;
use Camel\Format;

$transformer1 = new CaseTransformer(new Format\SnakeCase, new Format\CamelCase);
$transformer2 = new CaseTransformer(new Format\CamelCase, new Format\ScreamingSnakeCase);

echo $transformer1->transform('hello_world'); // helloWorld
echo $transformer2->transform('helloWorld');  // HELLO_WORLD