Skip to content

piperer/arraydot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arraydot

Helper functions to deal with array dotting

Installation

composer require cipherpixel/arraydot --no-dev

Examples

$array = [
    'config' =>
        'group' => [
            'setting'  => 'value',
            'setting2' => 'value2',
        ],
    ],
];

$array = array_dot($array);

// Elements can now be accessed using dot notation, like the example below.
// Echos: 'value';
echo $array['config.group.setting'];

// To return the array back to the original, the following
// line can be used.
$array = array_undot($array);

// Echos 'value2'
echo $array['config']['group']['setting2'];

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages