colorium/arraydot

Traversable array with dot notation

v0.2 2016-01-05 07:44 UTC

This package is not auto-updated.

Last update: 2024-06-18 17:37:37 UTC


README

Traversable array using dot notation

Using an instance :

use Colorium\Tools\ArrayDot;

$array = new ArrayDot([
    'foo' => [
        'bar' => 'baz'
    ]
]);

echo $array['foo.bar']; // 'baz'

Using static methods :

use Colorium\Tools\ArrayDot;

$array = [
    'foo' => [
        'bar' => 'baz'
    ]
]

echo ArrayDot::get($array, 'foo.bar'); // 'baz'

Install

composer require colorium/arraydot