![php](https://habrastorage.org/r/w120/files/373/e8b/dd3/373e8bdd3cb644d3bbeba47d34d1876d.png)
PHP
0
Вклад в тег
function findArray ($ar, $findValue, $executeKeys){
$result = array();
foreach ($ar as $k => $v) {
if (is_array($ar[$k])) {
$second_result = findArray ($ar[$k], $findValue, $executeKeys);
$result = array_merge($result, $second_result);
continue;
}
if ($v === $findValue) {
foreach ($executeKeys as $val){
$result[] = $ar[$val];
}
}
}
return $result;
}