PHPackages                             mawebdk/array-utils - 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. mawebdk/array-utils

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

mawebdk/array-utils
===================

ArrayUtils contains array utilities.

1.0.0(1y ago)02BSD-2-ClausePHPPHP ^8.3.6

Since Feb 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mawebdk/array-utils)[ Packagist](https://packagist.org/packages/mawebdk/array-utils)[ RSS](/packages/mawebdk-array-utils/feed)WikiDiscussions main Synced 1mo ago

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

array-utils
===========

[](#array-utils)

Use ArrayUtils to create an array from a JSON string and extract typed data from an array.

An ArrayUtilsException will be thrown if the array does not contain the given key or the value has an incorrect datatype.

Usage
-----

[](#usage)

Create an array from a JSON string.

```
try {
    $array = ArrayUtils::decodeJson(json: $json);
} catch (ArrayUtils $e) {
    // Error handling.
}

```

Extract typed data from an array.

```
try {
    $arrayValue         = ArrayUtils::getArrayFromKey(array $array, string $key);
    $arrayOrNullValue   = ArrayUtils::getArrayOrNullFromKey(array $array, string $key);
    $integerValue       = ArrayUtils::getIntegerFromKey(array $array, string $key);
    $integerOrNullValue = ArrayUtils::getIntegerOrNullFromKey(array $array, string $key);
    $floatValue         = ArrayUtils::getFloatFromKey(array $array, string $key);
    $stringValue        = ArrayUtils::getStringFromKey(array $array, string $key);
    $stringOrNullValue  = ArrayUtils::getStringOrNullFromKey(array $array, string $key);
    $booleanValue       = ArrayUtils::getBooleanFromKey(array $array, string $key);
} catch (ArrayUtils $e) {
    // Error handling.
}

```

Use getStringAsIntegerFromKey() if the value is a string with an integer value, e.q. `'123'`.

```
try {
    $integerValue = ArrayUtils::getStringAsIntegerFromKey(array $array, string $key);
} catch (ArrayUtils $e) {
    // Error handling.
}

```

Use getMixedFromKey() if you just want to extract data from an array without check of the datatype.

```
try {
    $integerValue = ArrayUtils::getMixedFromKey(array $array, string $key);
} catch (ArrayUtils $e) {
    // Error handling.
}

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance43

Moderate activity, may be stable

Popularity2

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

449d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mawebdk-array-utils/health.svg)

```
[![Health](https://phpackages.com/badges/mawebdk-array-utils/health.svg)](https://phpackages.com/packages/mawebdk-array-utils)
```

###  Alternatives

[koss-shtukert/laravel-nova-select2-auto-complete

A Laravel Nova field.

39310.1k](/packages/koss-shtukert-laravel-nova-select2-auto-complete)[werd/ivona-speechcloud-sdk-php

IVONA SpeechCloud SDK for PHP

102.1k](/packages/werd-ivona-speechcloud-sdk-php)

PHPackages © 2026

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