Skip to content

toolpage/php-case-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Case Converter

The PHP Case Converter collection helps changing the cases of existing texts.

Usage

<?php
require_once("CaseConverter.php");
$converter = new CaseConverter();

$input = "The quick brown fox jumps over the lazy dog";

$converter->convertToUpperCase($input);   // THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
$converter->convertToLowerCase($input);   // the quick brown fox jumps over the lazy dog
$converter->convertToStartCase($input);   // The Quick Brown Fox Jumps Over The Lazy Dog
$converter->convertToCamelCase($input);   // TheQuickBrownFoxJumpsOverTheLazyDog
$converter->convertToSnakeCase($input);   // The_Quick_Brown_Fox_Jumps_Over_The_Lazy_Dog
$converter->convertToKebabCase($input);   // the-quick-brown-fox-jumps-over-the-lazy-dog
$converter->convertToStudlyCaps($input);  // THe QUiCk BRoWn FoX JUMps oVeR thE LazY dOG
$converter->invertCase($input);           // tHE QUICK BROWN FOX JUMPS OVER THE LAZY DOG

Online Resources

Get more information and online tools for this implementation on https://en.toolpage.org/cat/case-converter