PHPackages                             weew/helpers-array - 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. weew/helpers-array

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

weew/helpers-array
==================

Useful collection of php array helpers.

v1.3.1(9y ago)79.8M—3.2%120MITPHP

Since Jul 21Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (14)Used By (20)

Array helpers
=============

[](#array-helpers)

[![Build Status](https://camo.githubusercontent.com/1c700141494571682ab9a04a2c7224d74556df2295720cd4762d1cdd739d80e2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f776565772f68656c706572732d61727261792e737667)](https://travis-ci.org/weew/helpers-array)[![Test Coverage](https://camo.githubusercontent.com/a8775426fdc17233424105397897fbdb64b1876c9c4463c94dda29f00715f62c/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f776565772f68656c706572732d61727261792e737667)](https://coveralls.io/github/weew/helpers-array)[![Version](https://camo.githubusercontent.com/cc9dcd4fb7cfef2e8d89b3b980bfdd264ecb2d3a7ee68a94e9df35e869de9129/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776565772f68656c706572732d61727261792e737667)](https://packagist.org/packages/weew/helpers-array)[![Licence](https://camo.githubusercontent.com/336623c03f65aea74154110eeced3a4e15604396209356858188d4264b6a220e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f776565772f68656c706572732d61727261792e737667)](https://packagist.org/packages/weew/helpers-array)

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Introduction](#introduction)
- [Functions](#functions)
    - [array\_get](#array_get)
    - [array\_has](#array_has)
    - [array\_set](#array_set)
    - [array\_remove](#array_remove)
    - [array\_add](#array_add)
    - [array\_take](#array_take)
    - [array\_first](#array_first)
    - [array\_last](#array_last)
    - [array\_reset](#array_reset)
    - [array\_dot](#array_dot)
    - [array\_extend](#array_extend)
    - [array\_extend\_distinct](#array_extend_distinct)
    - [array\_is\_associative](#array_is_associative)
    - [array\_is\_indexed](#array_is_indexed)
    - [array\_contains](#array_contains)

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

[](#installation)

`composer require weew/helpers-array`

Introduction
------------

[](#introduction)

This tiny library provides various helper functions to deal with arrays.

Functions
---------

[](#functions)

#### array\_get

[](#array_get)

Get an item from an array using "dot" notation.

`mixed array_get(array $array, mixed $key [, mixed $default = null])`

#### array\_has

[](#array_has)

Check if an item exists in an array using "dot" notation.

`bool array_has(array $array, mixed $key)`

#### array\_set

[](#array_set)

Set an array item to a given value using "dot" notation.

`array array_set(array &$array, mixed $key, mixed $value)`

#### array\_remove

[](#array_remove)

Remove one or many array items from a given array using "dot" notation.

`void array_remove(array &$array, mixed $keys)`

#### array\_add

[](#array_add)

Add an element to the array at a specific location using the "dot" notation.

`array array_add(array &$array, mixed $key, mixed $value)`

#### array\_take

[](#array_take)

Get an element and remove it from the array using the "dot" notation.

`array array_take(array &$array, mixed $key, [, mixed $default = null])`

#### array\_first

[](#array_first)

Get the first element from an array.

`array array_first(array &$array, [, mixed $default = null])`

#### array\_last

[](#array_last)

Get the last element from an array.

`array array_last(array &$array, [, mixed $default = null])`

#### array\_reset

[](#array_reset)

Reset all numerical indexes of an array (start from zero). Non-numerical indexes will stay untouched.

`array array_reset(array $array [, bool $deep = false])`

#### array\_dot

[](#array_dot)

Flatten a multi-dimensional associative array with dots.

`array array_dot(array $array [, string $prepend = ''])`

#### array\_extend

[](#array_extend)

Extend one array with another.

`array array_extend(array $arrays [, array $...])`

#### array\_extend\_distinct

[](#array_extend_distinct)

Extend one array with another. Non associative arrays will not be merged but rather replaced.

`array array_extend_distinct(array $arrays [, array $...])`

#### array\_is\_associative

[](#array_is_associative)

Check if the given array is associative.

`bool array_is_associative(array $array)`

#### array\_is\_indexed

[](#array_is_indexed)

Check if an array has a numeric index.

`bool array_is_indexed(array $array)`

#### array\_contains

[](#array_contains)

Check if array contains a specific element.

`array array_contains(array $array, mixed $search [, bool $strict = true])`

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

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 ~30 days

Recently: every ~62 days

Total

13

Last Release

3588d ago

Major Versions

v0.0.8 → v1.0.02015-11-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/10b2b854b5829dd13a15967c000ed2119b5faef67aca24d94c653c8ac550d85e?d=identicon)[weew](/maintainers/weew)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[eftec/statemachineone

A state Machine library for business processes

1144.0k](/packages/eftec-statemachineone)

PHPackages © 2026

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