PHPackages                             michaelm/array\_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. michaelm/array\_helpers

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

michaelm/array\_helpers
=======================

Array helpers functions based on laravel array helper functions.

08[1 issues](https://github.com/FvsJ101/array_helper/issues)PHP

Since Jul 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/FvsJ101/array_helper)[ Packagist](https://packagist.org/packages/michaelm/array_helpers)[ RSS](/packages/michaelm-array-helpers/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

BASIC ARRAY HELPERS BASED ON LARAVEL
====================================

[](#basic-array-helpers-based-on-laravel)

This is just a few basic array helper functions based on the laravel array helper functions.

Install
-------

[](#install)

Install via [composer](https://packagist.org/packages/michaelm/array_helpers):

1. composer require `michaelm/array_helpers`
2. Run `composer install` and do a `composer dumpautoload -o` to optimise the autoloader.

Usages
------

[](#usages)

###### Get, Has, Only, Forget

[](#get-has-only-forget)

```
$user = [
    "name" => "Mike",
    "topics" => [
        "city" => "Pretoria",
        "title" => "Winning"
    ],
    "country" => [
        ["name" => "UK"],
        ["name" => "USA"],
    ]
];

echo array_get($user, 'topics.city', 'Default value');

var_dump(array_has($user, ['name', 'country.0.name']));

$result = array_only($user, ['country', 'topics']);
echo '',print_r($result,true),'';

array_forget($user, 'name');
//array_forget($user, ['name', 'topics', 'country.0']);

echo '',print_r($user,true),'';
```

###### First, Where, Last

[](#first-where-last)

```
$users = [
   ["name" => "Mike", "score" => 100],
   ["name" => "Tim", "score" => 110],
   ["name" => "Ralf", "score" => 120],
];

$user = array_last($users, function ($value, $key) {
    return array_get($value, 'score') < 110;
});

echo '',print_r($user,true),'';

$user = array_first($users, function ($value, $key){

    return array_get($value, 'score') > 110 ;

}, 'default value');

var_dump($user);

$result = array_where($users, function ($value, $key) {

    return array_get($value, 'score') > 100;
});

var_dump($result);
```

Credits
-------

[](#credits)

[CodeCourse](https://codecourse.com/) released under the MIT license.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/57ee66ee4e4edd177090177a8dd8b720832b0b19fd083ef2ba3e9d313e458a68?d=identicon)[FvsJ101](/maintainers/FvsJ101)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/michaelm-array-helpers/health.svg)

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

PHPackages © 2026

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