This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".  
Status: 2023-12-28

ArrDot - [array dot notation]

with ArrDot you can access arrays via dot notation.


$oArrDot = new ArrDot(array $aArray);

create a new instance of ArrDot

$oArrDot = new ArrDot(
        'user' => [
            'foo' => 'bar',
            'john' => 'doe'
        'etc' => [
            'OS' => 'Linux'


$oArrDot->set(string $sKey, mixed);

add a key/value by set method

$oArrDot->set('user.mary', 'moo');


$oArrDot->get(string $sKey);

get complete array

$aMyArray = $oArrDot->get();
// type: array, items: 2
    'user' => [
        'foo' => 'bar',
        'john' => 'doe',
        'mary' => 'moo',
    'etc' => [
        'OS' => 'Linux',

get value on an existing key

// type: string


searches for a value in given array; returns dot notation address on the first hit.

get key on existing value

// type: string