PHP code example of jakew / cases

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

    

jakew / cases example snippets


// You can add custom words in, for special cases.
Dictionary::getInstance()->addWord('eMail', 'email');

$phrase = Phrase::decode('ExamplePhrase');
echo $phrase->getSnakeCase();
# example-phrase

$phrase = Phrase::decode('ExamplePhrase');
echo $phrase->getSnakeCase('_');
# example_phrase

$phrase = Phrase::decode('example-phrase');
echo $phrase->getCamelCase();
# ExamplePhrase

$phrase = Phrase::decode('email_phrase');
echo $phrase->getCamelCase(false);
# examplePhrase

$phrase = Phrase::decode('email-address');
echo $phrase->getCamelCase();
# eMailAddress