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.
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/
Via Composer
$ composer require khuddus/php-camel-case-helpers
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'
]
]
]
]
]
*/
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.