PHP code example of ghostwriter / case-converter
1. Go to this page and download the library: Download ghostwriter/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/ */
ghostwriter / case-converter example snippets
use GhostWriter\CaseConverter\CaseConverter;
$string = 'The quick, brown fox jumps over the lazy dog.';
// $caseConverter = new CaseConverter();
// or
$caseConverter = CaseConverter::new();
// The_Quick_Brown_Fox_Jumps_Over_The_Lazy_Dog
$caseConverter->toAdaCase($string);
// theQuickBrownFoxJumpsOverTheLazyDog
$caseConverter->toCamelCase($string);
// THE-QUICK-BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG
$caseConverter->toCobolCase($string);
// the.quick.brown.fox.jumps.over.the.lazy.dog
$caseConverter->toDotCase($string);
// the-quick-brown-fox-jumps-over-the-lazy-dog
$caseConverter->toKebabCase($string);
// the quick brown fox jumps over the lazy dog
$caseConverter->toLowerCase($string);
// THE_QUICK_BROWN_FOX_JUMPS_OVER_THE_LAZY_DOG
$caseConverter->toMacroCase($string);
// TheQuickBrownFoxJumpsOverTheLazyDog
$caseConverter->toPascalCase($string);
// The quick brown fox jumps over the lazy dog
$caseConverter->toSentenceCase($string);
// the_quick_brown_fox_jumps_over_the_lazy_dog
$caseConverter->toSnakeCase($string);
// The Quick Brown Fox Jumps Over The Lazy Dog
$caseConverter->toTitleCase($string);
// The-Quick-Brown-Fox-Jumps-Over-The-Lazy-Dog
$caseConverter->toTrainCase($string);
// THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
$caseConverter->toUpperCase($string);