2017 © Pedro Peláez
 

library apath

A way to access data for multidimensional PHP arrays and objects.

image

punarinta/apath

A way to access data for multidimensional PHP arrays and objects.

  • Thursday, February 9, 2017
  • by punarinta
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

APath

A way to access data in objects and multidimensional arrays., (*1)

Usage

use APath\APath;

$sample =
[
    'foo' =>
    [
        'bar' =>
        [
            'x1' => 'hello, world',
            'x2',
            'x3' => 'bye-bye, world',
        ],
    ],
    'some' =>
    [
        'data',
        'x1337' => 'LEET',
    ],
    [1, 4, 'xxx' => 'yyy', 88],
];

// get the whole structure
print_r(APath::get($sample));

// get by keys
print_r(APath::get($sample, 'foo.bar'));

// or by numeric offset
print_r(APath::get($sample, '0.2'));

// or even combine them
print_r(APath::get($sample, 'some.0'));

// trying to get a non-existent part will simply result a null 
print_r(APath::get($sample, 'some.unreal.path'));

The Versions

09/02 2017

dev-master

9999999-dev

A way to access data for multidimensional PHP arrays and objects.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Vladimir Osipov

array access

09/02 2017

v1.0

1.0.0.0

A way to access data for multidimensional PHP arrays and objects.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Vladimir Osipov

array access