PHPackages                             kamyshev/array\_find - 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. kamyshev/array\_find

Abandoned → [kamyshev/array\_actions](/?search=kamyshev%2Farray_actions)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

kamyshev/array\_find
====================

A PHP function that find element in an array by a callback.

v1.0(8y ago)12.4kMITPHPPHP &gt;=7.0

Since Feb 15Pushed 7y agoCompare

[ Source](https://github.com/TheNovel/array_find)[ Packagist](https://packagist.org/packages/kamyshev/array_find)[ Docs](https://github.com/TheNovel/array_find)[ RSS](/packages/kamyshev-array-find/feed)WikiDiscussions master Synced 2d ago

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

[![Packagist](https://camo.githubusercontent.com/0f1f3f78d7313246b7e33b1d71a8d3f3e322dcf2c489faf55d7903b295b9d3e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b616d79736865762f61727261795f66696e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kamyshev/array_find)[![Build Status](https://camo.githubusercontent.com/5cb27fd2e8a219dd2446953730c7de111924a52ba77a9ce19548319ed511c32c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f69676f726b616d79736865762f61727261795f66696e642f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/igorkamyshev/array_find)[![GitHub license](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://raw.githubusercontent.com/TheNovel/array_find/master/LICENSE)

\[DEPRECATED\] This is no longer supported, please consider using [array\_actions](https://github.com/igorkamyshev/array_actions) instead.

array\_find
===========

[](#array_find)

> A PHP function that find element in an array by a callback.

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

[](#installation)

To get the latest version of `array_find`, simply require the project using Composer:

```
$ composer require kamyshev/array_find
```

If you do not want to use Composer, you can just `require` the `src/array_find.php` file.

Usage
-----

[](#usage)

To use `array_find`, simply pass an array and callback:

```
$records = [
    [
        'state'  => 'IN',
        'city'   => 'Indianapolis',
        'object' => 'School bus',
    ],
    [
        'state'  => 'IN',
        'city'   => 'Indianapolis',
        'object' => 'Manhole',
    ],
    [
        'state'  => 'IN',
        'city'   => 'Plainfield',
        'object' => 'Basketball',
    ],
    [
        'state'  => 'CA',
        'city'   => 'San Diego',
        'object' => 'Light bulb',
    ],
    [
        'state'  => 'CA',
        'city'   => 'Mountain View',
        'object' => 'Space pen',
    ],
];

$grouped = array_find($records, function ($state) {
    return $state['city'] === 'San Diego';
});
```

Example output:

```
Array
(
    [state] => CA
    [city] => San Diego
    [object] => Light bulb
)

```

If the element was not found, `array_find` returns `null`.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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

2

Last Release

3058d ago

Major Versions

v0.1 → v1.02018-02-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb826bf7775f0574a417b011442f33dd0ec6c593ac2a10b7c7402520a5e4eaa4?d=identicon)[igor.kamyshev](/maintainers/igor.kamyshev)

---

Top Contributors

[![igorkamyshev](https://avatars.githubusercontent.com/u/26767722?v=4)](https://github.com/igorkamyshev "igorkamyshev (8 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (1 commits)")

---

Tags

arrayfindarray\_find

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kamyshev-array-find/health.svg)

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

###  Alternatives

[doctrine/collections

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

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

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

2.8k317.3M3.1k](/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.1k430.4M1.7k](/packages/nette-utils)[league/config

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

565335.0M35](/packages/league-config)[cuyz/valinor

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

1.5k13.2M166](/packages/cuyz-valinor)[aimeos/map

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

4.3k459.4k15](/packages/aimeos-map)

PHPackages © 2026

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