nnssn / str-rename
Converts the camel case and snake case each other.
Installs: 1 202
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2025-01-04 21:47:14 UTC
README
Converts the camel case and snake case each other.
Requirement
PHP 5.4.0
Install
composer require nnssn/str-rename
Usage
require 'vendor/autoload.php';
use Nnssn\Str\Rename;
echo Rename::snake('camelCase'); // camel_case
echo Rename::snake('PascalCase'); // pascal_case
echo Rename::snake('twitter-bootstrap'); // twitter_bootstrap
echo Rename::camel('snake_case'); // snakeCase
echo Rename::camel('PascalCase'); // pascalCase
echo Rename::camel('twitter-bootstrap'); // twitterBootstrap
Methods
Rename::snake
Rename::constant
Rename::hyphen
Rename::camel
Rename::pascal
Rename::unite
Rename::uniteUp