PHPackages                             khuddus/php-camel-case-helpers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. khuddus/php-camel-case-helpers

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

khuddus/php-camel-case-helpers
==============================

A php tool to convert underscored or dashed arrays to camelcased arrays

1.0.0(6y ago)585MITPHPPHP &gt;=7.2.0CI passing

Since Dec 22Pushed 1w ago1 watchersCompare

[ Source](https://github.com/khuddus/php-camel-case-helpers)[ Packagist](https://packagist.org/packages/khuddus/php-camel-case-helpers)[ Docs](https://github.com/khuddus/php-camel-case-helpers)[ RSS](/packages/khuddus-php-camel-case-helpers/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

php camel case helpers
======================

[](#php-camel-case-helpers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ad4703a961b16f47fb8fcdc8edcf39b7214440d4322ad3d0b24bae4ffca664f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6875646475732f7068702d63616d656c2d636173652d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/khuddus/php-camel-case-helpers)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/37ab20d7d827fbe20eb813572aced2798a2e9e7f05552518f1c3cb0821469f95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b6875646475732f7068702d63616d656c2d636173652d68656c706572732f63692e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/khuddus/php-camel-case-helpers/actions/workflows/ci.yml)[![Total Downloads](https://camo.githubusercontent.com/463135cd6b3f4ea511755b556bcc2e857a036070df7736dea4d4d7ad198a1d23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6875646475732f7068702d63616d656c2d636173652d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/khuddus/php-camel-case-helpers)

A PHP library that provides camel case helpers. Convert array keys or strings containing underscores, hyphens, or spaces into camelCase.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1

Install
-------

[](#install)

```
composer require khuddus/php-camel-case-helpers
```

Usage
-----

[](#usage)

### String Helper

[](#string-helper)

Converts a string to camelCase.

```
use Khuddus\Helpers\CamelCase\StringHelper;

StringHelper::convertToCamelCasedString("Hello world");       // helloWorld
StringHelper::convertToCamelCasedString("Hello-world");       // helloWorld
StringHelper::convertToCamelCasedString("Hello_world");       // helloWorld
StringHelper::convertToCamelCasedString("hello_beautiful_world"); // helloBeautifulWorld
```

### Array Helper

[](#array-helper)

Recursively converts all non-numeric array keys to camelCase.

```
use Khuddus\Helpers\CamelCase\ArrayHelper;

// Convert all levels (default)
ArrayHelper::convertToCamelCasedArray(['hello_world' => 1]);
// ['helloWorld' => 1]

// Limit conversion depth with the optional $level parameter
// $level = 0  → no conversion
// $level = 1  → top-level keys only
// $level = null (default) → all levels

ArrayHelper::convertToCamelCasedArray([
    'Hello World' => [
        'My----World' => 'this world',
    ],
    [
        'another -_-_WOrld' => [
            'Busy_World' => [
                'instruMental World' => [
                    'courageous--World' => 'mine',
                ],
            ],
        ],
    ],
], 3);

/*
[
    'helloWorld' => [
        'myWorld' => 'this world',
    ],
    [
        'anotherWOrld' => [
            'busyWorld' => [
                'instruMental World' => [   // level 3 — not converted
                    'courageous--World' => 'mine',
                ],
            ],
        ],
    ],
]
*/
```

Testing
-------

[](#testing)

```
composer test
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Abdul Khuddus](https://github.com/khuddus)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance64

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2331d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3508305?v=4)[Abdul Khuddus](/maintainers/khuddus)[@khuddus](https://github.com/khuddus)

---

Top Contributors

[![khuddus](https://avatars.githubusercontent.com/u/3508305?v=4)](https://github.com/khuddus "khuddus (28 commits)")

---

Tags

khudduscamel case json phpphp camel case array helpercamel case string helperphp camel case

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/khuddus-php-camel-case-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/khuddus-php-camel-case-helpers/health.svg)](https://phpackages.com/packages/khuddus-php-camel-case-helpers)
```

###  Alternatives

[andrefigueira/blog-article-faker

Generate random blog article titles and content (including markdown) using faker

1415.0k](/packages/andrefigueira-blog-article-faker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
