Skip to content

extphp/data-dot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Dot

Build Status Latest Stable Version License Total Downloads

A simple dot notation accessor, able to handle a mix of arrays and objects.

Usage

<?php

use ExtPHP\DataDot\Dot;

$data = [
    'eyes'  => 'blue',
    'age'   => '27',
    'parents' => [
        'mother'    => 'Jane',
        'father'    => 'Jack'
    ]
];

$dot = new Dot($data);

$dot->get('parents.father', 'John');    // returns 'Jack'
$dot->get('sister', 'Kate');            // returns 'Kate'

Testing

php vendor/bin/phpunit

About

A property accessor helper capable of using dot notation for a mix of arrays and objects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages