Two arrays are given, first:
$array = [ 'one' => 'a', 'two' => [ 'default' => 'b', 'three' => [ 'default' => 'c', 'four' => 'd' ], ], ]; second:
$p = ['two', 'three', 'default']; It is necessary to obtain a value from the first array, the path to which is written in the second array. In this example, it is c .