PHPackages                             selvinortiz/dot - 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. selvinortiz/dot

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

selvinortiz/dot
===============

Simplified array dot notation for PHP

v1.1.0(9y ago)71822[1 issues](https://github.com/selvinortiz/dot/issues)[1 PRs](https://github.com/selvinortiz/dot/pulls)MITPHP

Since Jun 25Pushed 3y ago3 watchersCompare

[ Source](https://github.com/selvinortiz/dot)[ Packagist](https://packagist.org/packages/selvinortiz/dot)[ RSS](/packages/selvinortiz-dot/feed)WikiDiscussions master Synced 4w ago

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

[![Dot](Dot.png)](Dot.png)

[![Build Status](https://camo.githubusercontent.com/55891ce08ad6d625797ec652c5af1760587d390ed0328a47c6ecb5dea0c3f26e/68747470733a2f2f7472617669732d63692e6f72672f73656c76696e6f7274697a2f646f742e706e67)](https://travis-ci.org/selvinortiz/dot)[![Total Downloads](https://camo.githubusercontent.com/5e1bc58f1c3dbc7e71d4685ec41d64c64bd90440192afd81e789af22ee706e91/68747470733a2f2f706f7365722e707567782e6f72672f73656c76696e6f7274697a2f646f742f642f746f74616c2e706e67)](https://packagist.org/packages/selvinortiz/dot)[![Latest Stable Version](https://camo.githubusercontent.com/cef56e1fc9b1bdd7c17f26199f8bd3ce0622149041cf094a1141c3abb78d5972/68747470733a2f2f706f7365722e707567782e6f72672f73656c76696e6f7274697a2f646f742f762f737461626c652e706e67)](https://packagist.org/packages/selvinortiz/dot)

### Description

[](#description)

> **Dot** is a tiny library and implements array *dot notation* for PHP written by [Selvin Ortiz](https://selvinortiz.com)

### Requirements

[](#requirements)

- PHP 7.1+
- [Composer](http://getcomposer.org) and [selvinortiz/dot](https://packagist.org/packages/selvinortiz/dot)

### Install

[](#install)

```
composer require selvinortiz/dot
```

### Test

[](#test)

```
sh spec.sh
```

### Usage

[](#usage)

> To use **Dot** after proper installation, just *autoload* it, *use* it, and call methods on it:)

```
$input = [
    'name' => [
        'first' => 'Brad',
        'last'  => 'Bell',
    ],
    'spouse' => [
        'name' => [
            'first' => 'Brandon',
            'last'  => 'Kelly'
        ],
        'mood' => 'Happy',
        'age'  => '75',
    ],
    'mood' => 'Angry',
    'age'  => 25,
];

Dot::has($input, 'spouse');
// true

Dot::has($input, 'mistress.relationship');
// false

Dot::get($input, 'spouse.name.last');
// 'Kelly'

Dot::get($input, 'spouse');
/*
[
    'name' => [
        'first' => 'Brandon',
        'last'  => 'Kelly'
    ],
    'mood' => 'Happy',
    'age'  => '75'
]
*/

Dot::set($input, 'spouse.name.last', 'Bell');
/* $input will be mutated with a changed value
[
    'name' => [
        'first' => 'Brad',
        'last'  => 'Bell',
    ],
    'spouse' => [
        'name' => [
            'first' => 'Brandon',
            'last'  => 'Bell'
        ],
        'mood' => 'Happy',
        'age'  => '75',
    ],
    'mood' => 'Angry',
    'age'  => 25,
];
*/

Dot::delete($input, 'spouse.mood');
/* $input will be mutated with a key/value deleted
[
    'name' => [
        'first' => 'Brad',
        'last'  => 'Bell',
    ],
    'spouse' => [
        'name' => [
            'first' => 'Brandon',
            'last'  => 'Bell'
        ]
        'age'  => '75',
    ],
    'mood' => 'Angry',
    'age'  => 25,
];
*/
```

### API

[](#api)

> **Dot** has a very small API and hoping to keep it small and to the point.

#### `Dot::has($arr, $key)`

[](#dothasarr-key)

> Returns whether or not `$arr` has `$key`. Put another way, `$key` exists in `$arr`

#### `Dot::get($arr, $key, $default = null)`

[](#dotgetarr-key-default--null)

> Returns the value found in `$arr` by `$key` or `$default` provided

#### `Dot::set(array &$arr, $key, $value)`

[](#dotsetarray-arr-key-value)

> Mutates the `$arr` by adding a new `$key` with `$value` provided

#### `Dot::delete(array &$arr, $key)`

[](#dotdeletearray-arr-key)

> Mutates the `$arr` by delete `$key` and its associated value if found

### Contribute

[](#contribute)

> **Dot** wants to be friendly to *first time contributors*. Just follow the steps below and if you have questions along the way, please reach out.

1. Fork it!
2. Create your `bugfix` or `feature` branch
3. Commit and push your changes
4. Submit a pull request

### License

[](#license)

**Dot** is open source software licensed under the [MIT License](LICENSE.txt)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~12 days

Total

2

Last Release

3646d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/93d52d70a5bafe64daf0512be1f3473bae56fa5bfb255258e30d6de3dcfcd170?d=identicon)[selvinortiz](/maintainers/selvinortiz)

---

Top Contributors

[![selvinortiz](https://avatars.githubusercontent.com/u/1922523?v=4)](https://github.com/selvinortiz "selvinortiz (6 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

### Embed Badge

![Health badge](/badges/selvinortiz-dot/health.svg)

```
[![Health](https://phpackages.com/badges/selvinortiz-dot/health.svg)](https://phpackages.com/packages/selvinortiz-dot)
```

###  Alternatives

[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2222.6M322](/packages/drupal-core-dev)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

39250.0k28](/packages/ec-europa-toolkit)

PHPackages © 2026

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