PHP code example of ptrkcsk / change-case

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

    

ptrkcsk / change-case example snippets


use ChangeCase\ChangeCase;

ChangeCase::camel('test string');      // 'testString'
ChangeCase::lowerCamel('test string'); // 'testString'

use ChangeCase\ChangeCase;

ChangeCase::constant('test string');       // 'TEST_STRING'
ChangeCase::screamingSnake('test string'); // 'TEST_STRING'

use ChangeCase\ChangeCase;

ChangeCase::dot('test string'); // 'test.case'

use ChangeCase\ChangeCase;

ChangeCase::header('test string'); // 'Test-String'

use ChangeCase\ChangeCase;

ChangeCase::lower('test string'); // 'test string'

use ChangeCase\ChangeCase;

ChangeCase::lowerFirst('TEST STRING'); // 'tEST STRING'

use ChangeCase\ChangeCase;

ChangeCase::no('test string'); // 'test string'

use ChangeCase\ChangeCase;

ChangeCase::param('test string'); // 'test-string'
ChangeCase::kebab('test string'); // 'test-string'
ChangeCase::lisp('test string');  // 'test-string'

use ChangeCase\ChangeCase;

ChangeCase::pascal('test string');     // 'TestString'
ChangeCase::upperCamel('test string'); // 'TestString'

use ChangeCase\ChangeCase;

ChangeCase::path('test string'); // 'test/string'

use ChangeCase\ChangeCase;

ChangeCase::sentence('test string'); // 'Test string'

use ChangeCase\ChangeCase;

ChangeCase::snake('test string');   // 'test_string'
ChangeCase::pothole('test string'); // 'test_string'

use ChangeCase\ChangeCase;

ChangeCase::swap('TeSt StRiNg'); // 'tEsT sTrInG'

use ChangeCase\ChangeCase;

ChangeCase::title('test string'); // 'Test String'
ChangeCase::start('test string'); // 'Test String'

use ChangeCase\ChangeCase;

ChangeCase::upper('test string');   // 'TEST STRING'
ChangeCase::allCaps('test string'); // 'TEST STRING'

use ChangeCase\ChangeCase;

ChangeCase::upperFirst('test string');  // 'Test string'