Skip to content

About

A lightweight PHP package for reading, writing, checking, and deleting deeply nested array values using dot notation and wildcards.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

10 stars

Watchers

1 watching

Forks

Repository files navigation

PHP Version : 8.6 License Build
Source Packagist Version Packagist Downloads

Read, write, check and delete values in nested PHP arrays with dot-notation paths and wildcards.


Installation

composer require pharaonic/php-dot-array

Usage

$dot = dot(['users' => [['name' => 'Ahmed'], ['name' => 'Sara', 'phone' => null]]]);

$dot->get('users.0.name');           // "Ahmed"
$dot->get('users.*.name');           // ["Ahmed", "Sara"]
$dot->get('users.1.phone', 'n/a');   // "n/a"

$dot->set('users.*.active', true)->delete('users.1.phone');

Documentation

Full documentation: PHP Dot Array Documentation.

Support & Security

See SUPPORT.md and SECURITY.md. Contributions are welcome; see CONTRIBUTING.md.

License

MIT. See LICENSE.

About

A lightweight PHP package for reading, writing, checking, and deleting deeply nested array values using dot notation and wildcards.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages