khuddus / php-camel-case-helpers
A php tool to convert underscored or dashed arrays to camelcased arrays
Requires
- php: >=7.2.0
Requires (Dev)
- phpunit/phpunit: >=8.0
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2025-04-23 13:47:59 UTC
README
A php library provides camel case helpers. You can use array helper, to convert an array to camelCase keyed array, or you can use string helper to convert a string to camel case.
Structure
If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.
bin/
build/
docs/
config/
src/
tests/
vendor/
Install
Via Composer
$ composer require khuddus/php-camel-case-helpers
Usage
use Khuddus\Helpers\CamelCase\ArrayHelper; use Khuddus\Helpers\CamelCase\StringHelper; echo StringHelper::convertToCamelCasedString("Hello world"); //echoes helloWorld $convertedArray = ArrayHelper::convertToCamelCasedArray(['hello world'=>1]); //converts to ['helloWorld'=>1] $convertedArray = ArrayHelper::convertToCamelCasedArray(['hello world'=>1]); //converts to ['helloWorld'=>1] ArrayHelper::convertToCamelCasedArray([ 'Hello World'=>[ 'My----World'=>'this world' ], [ 'another -_-_WOrld'=>[ 'Busy_World'=>[ 'instruMental World'=>[ 'courageous--World'=>'mine' ] ] ] ] ], 3); /* converts it to [ 'helloWorld'=>[ 'myWorld'=>'this world' ], [ 'anotherWOrld'=>[ 'busyWorld'=>[ 'instruMental World'=>[ 'courageous--World'=>'mine' ] ] ] ] ] */
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email khuddus1+github@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.