Skip to content

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.

License

Notifications You must be signed in to change notification settings

khuddus/php-camel-case-helpers

Repository files navigation

php camel case helpers

Latest Version on Packagist Software License Build Status Total Downloads

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 [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

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.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages