elleyeayeme / case-converter
A converter for strings in most popular cases
Installs: 14 947
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ^6.3
This package is not auto-updated.
Last update: 2025-08-17 07:01:30 UTC
README
This package allows strings in any of the popular formats (e.g. camel case and snake case) to be converted between one another.
Installation
Install the latest version with:
composer require elleyeayeme/case-converter
Basic Usage
<?php use CaseConverter\CaseConverter; $converter = new CaseConverter; // Outputs a_string_with_99_numbers echo $converter->convert('aStringWith99Numbers') ->from('camel') ->to('snake');
See the Supported Formats section for a list of the tokens to pass to from()
and to()
for conversion.
Supported Formats
The formats supported at present are:
- Camel case (token:
camel
) i.e. thisIsCamelCase - Kebab case (token:
kebab
) i.e. this-is-kebab-case - Snake case (token:
snake
) i.e. this_is_snake_case - Studly caps (token:
studly
) i.e. ThisIsStudlyCaps - Standard text (token:
standard
) i.e. this is standard text
License
Case Converter is licensed under the MIT license.