muse/array_nested

Set/Get a nested array value

1.0.3 2020-01-30 18:34 UTC

This package is auto-updated.

Last update: 2020-08-30 01:57:07 UTC


README

Get deep value in nested array by keys

$arr = ["deep" => ["vervy deep" => 123,],];
$val = array_nested($arr, ["deep", "vervy deep"]); // 123

Set deep value with keys

$arr = [42];
$prev = array_nested($arr, [1, 2, 3], "test"); // null
var_export($arr); // [0=>42, 1=>[2=>[3=>"test"]]]