PHPackages                             crissi/array-key-change - 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. crissi/array-key-change

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

crissi/array-key-change
=======================

Easily change keys in a array of any depth

v1.0.0(6y ago)0127MITPHPPHP &gt;=7.0.0CI failing

Since Nov 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/crissi/array-key-change)[ Packagist](https://packagist.org/packages/crissi/array-key-change)[ Docs](https://github.com/crissi/array-key-change)[ RSS](/packages/crissi-array-key-change/feed)WikiDiscussions master Synced 3d ago

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

*Easily change keys in a array of any depth*

Example:

```
$source = [
    'alpha' => [
        'bravo' => [
            'nested' => [1, 2, 3]
        ]
    ],
    'whiskey' => [44,45, 45],
    'charlie' => [
        ['foo' => '222'],
        ['foo' => '44444'],
        ['foo' => '444'],
        [
            'foo' => 'text',
            'lol' => '3434'
        ],
    ],
];

$result = ArrayKeyChange::in($source)
    ->skipMissingPaths()
    ->modify([
        'alpha.bravo.nested' => 'delta',
        'alpha' => 'foxtrot',
        'alpha.bravo' => 'echo',
        'charlie.*.lol' => 'rofl',
        'charlie' => 'omega'
    ]);

```

Result:

```
[
    'foxtrot' => [
        'echo' => [
            'delta' => [1, 2, 3]
        ]
    ],
    'whiskey' => [44,45, 45],
    'omega' => [
        ['foo' => '222'],
        ['foo' => '44444'],
        ['foo' => '444'],
        [
            'foo' => 'text',
            'rofl' => '3434'
        ],
    ],
];

```

> Use skipMissingPaths() to avoid errors on missing keys

> Use the star-operator (\*) to traverse sequential arrays

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

2384d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

arraychange key

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/crissi-array-key-change/health.svg)

```
[![Health](https://phpackages.com/badges/crissi-array-key-change/health.svg)](https://phpackages.com/packages/crissi-array-key-change)
```

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k411.1M1.2k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.2k412.9k11](/packages/aimeos-map)

PHPackages © 2026

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