/ Published in: PHP
поиÑк Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² многомерном маÑÑиве
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function find_in_arr($key, $arr) { foreach ($arr as $k=>$val) { if($k == $key) { return $val; } $result = find_in_arr($key, $val); if($result != false) { return $result; } } } return false; } 'name' => 'Php Master', 'subject' => 'Php', 'type' => 'Articles', 'one' => 'Iteration', 'two' => 'Recursion', 'factorial' => 'Recursion', 'fibonacci' => 'Recursion', ), ), 'parent' => 'Sitepoint', );
URL: http://phpmaster.com/understanding-recursion/