Mecha CMS

$anemon->set()

Set or replace array values recursively.

2.0.0

$anemon->set(string $key, $value = null, string $join = '.');

Example:

$array = new Anemon([
    'foo' => 1,
    'bar' => [
        'baz' => 2,
        'qux' => 3
    ]
]);

$array->set('bar.baz', '#');
$array->set('bar.wut', '#');

Result:

$array = Anemon::__set_state([
    'foo' => 1,
    'bar' => [
        'baz' => '#',
        'qux' => 3,
        'wut' => '#'
    ]
]);