$data = [
'param' => [
'param1' => '111',
'param2' => [
'param3' => '333'
]
]
];
function deep_get($arr, $keys, $default=False) {
return array_reduce(explode('.', $keys), function($d, $key){
if (is_array($d)) {
return $d[$key] ? $d[$key] : $default;
}else{
return $default;
}
},
$arr
);
}
echo deep_get($data, 'param.param2.param3');