silinternational / php-array-dot-notation
This package is abandoned and no longer maintained.
The author suggests using the sil-org/php-array-dot-notation package instead.
PHP library for using dot notation in arrays
Package info
github.com/sil-org/php-array-dot-notation
pkg:composer/silinternational/php-array-dot-notation
0.2.0
2025-01-07 19:24 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2026-02-17 22:32:12 UTC
README
A utility to use dot notation in PHP arrays.
Setup
- Clone this repo.
- Copy
local.env.disttolocal.envand update GitHub.com token as appropriate. - Run
make testto install dependencies and run PHPUnit tests.
Makefile script
There is a Makefile in place to simplify common tasks.
make test- doescomposer installand runs phpunit tests
Class DotNotation
Util class containing a single method to collapse a multi-dimensional array into a single-dimensional array. Array keys are combined using a dot to separate levels of the array. For instance:
[
'a' => [
'x' => 'data1',
],
'b' => 'data2',
]
will be collapsed to
[
'a.x' => 'data1',
'b' => 'data2',
]