PHPackages                             erdemuk/case-converter - 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. erdemuk/case-converter

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

erdemuk/case-converter
======================

The StringConverter package provides a convenient way to convert strings or array keys to the desired case format.

v1.3(2y ago)21.4k↓50%proprietaryPHPPHP &gt;=8.0

Since Jun 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/erdemuk/CaseConverter)[ Packagist](https://packagist.org/packages/erdemuk/case-converter)[ RSS](/packages/erdemuk-case-converter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (4)Used By (0)

CaseConverter
=============

[](#caseconverter)

CaseConverter is a powerful PHP library that provides a convenient way to convert text between different case formats. It supports popular case formats such as snake\_case, kebab-case, camelCase, PascalCase, and space case.

Installation
------------

[](#installation)

You can install CaseConverter to your project using Composer:

```
composer require erdemuk/case-converter
```

Usage
-----

[](#usage)

```
use CaseConverter\CaseConverter;

$input = 'hello_world';
$converted = CaseConverter::convertCase($input, new KebabCase);

echo $converted; // hello-world
```

In the above example, the convertCase method is used to convert the text hello\_world to kebab-case format.

Supported Letter Case Formats
-----------------------------

[](#supported-letter-case-formats)

- **SnakeCase**: Example: `hello_world`
- **KebabCase**: Example: `hello-world`
- **CamelCase**: Example: `helloWorld`
- **PascalCase**: Example: `HelloWorld`
- **SpaceCase**: Example: `Hello World`

Text Conversion
---------------

[](#text-conversion)

CaseConverter can convert a single text or texts within an array. Below are some usage examples:

### Converting a Single Text

[](#converting-a-single-text)

```
use CaseConverter\CaseConverter;

$input = 'hello_world';
$converted = CaseConverter::convertCase($input, new KebabCase);

echo $converted; // hello-world
```

### Converting Texts within an Array

[](#converting-texts-within-an-array)

```
use CaseConverter\CaseConverter;

$input = [
    'first_name' => 'John',
    'last_name' => 'Doe',
    'email_address' => 'john.doe@example.com'
];

$converted = CaseConverter::convertCase($input, new PascalCase);

print_r($converted);
/*
Array
(
    [FirstName] => John
    [LastName] => Doe
    [EmailAddress] => john.doe@example.com
)
*/
```

In the above example, the texts within the array are converted to the 'PascalCase' format.

### Converting Multidimensional Arrays

[](#converting-multidimensional-arrays)

CaseConverter can also handle multidimensional arrays. Here's an example:

```
use CaseConverter\CaseConverter;

$input = [
    'user' => [
        'firstName' => 'John',
        'lastName' => 'Doe',
        'emailAddress' => 'john.doe@example.com'
    ],
    'address' => [
        'street' => '123 Main St',
        'city' => 'New York',
        'country' => 'USA'
    ]
];

$converted = CaseConverter::convertCase($input, new SnakeCase);

print_r($converted);
/*
Array
(
    [user] => Array
        (
            [first_name] => John
            [last_name] => Doe
            [email_address] => john.doe@example.com
        )

    [address] => Array
        (
            [street] => 123 Main St
            [city] => New York
            [country] => USA
        )

)
*/
```

In the above example, the texts within a multidimensional array are converted to the 'snake\_case' format.

Contribution
------------

[](#contribution)

Contributions to CaseConverter are always welcome! If you find any bugs, issues, or have suggestions for improvement, please feel free to open an issue or submit a pull request on the GitHub repository.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~0 days

Total

3

Last Release

1061d ago

PHP version history (3 changes)v1.0PHP &gt;=8.2.5

v1.1PHP &gt;=8.2

v1.3PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7af4ff15226532f0d24db6c9904f5ccff47ef624e6d8524727334b1f38a5bee?d=identicon)[erdemuk](/maintainers/erdemuk)

---

Top Contributors

[![erdemuk](https://avatars.githubusercontent.com/u/2006915?v=4)](https://github.com/erdemuk "erdemuk (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/erdemuk-case-converter/health.svg)

```
[![Health](https://phpackages.com/badges/erdemuk-case-converter/health.svg)](https://phpackages.com/packages/erdemuk-case-converter)
```

PHPackages © 2026

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