PHP code example of ketchums / php-case-converter

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

    

ketchums / php-case-converter example snippets


composer 

use App\CaseDetector;
use App\CaseConverter;

$string = 'some.cool.string';

$detector = new CaseDetector();
$converter = new CaseConverter($string, $detector->detectType($string));

echo $converter->toPascalCase(); // someCoolString
echo $converter->toKebabCase(); // some-cool-string

echo $caseConvert->toCase('pascal'); // someCoolString
echo $caseConvert->toCase('kebab'); // some-cool-string