How to loop a tree array with unknown depth and get array blocks?
PHP Snippet 1:
function saveAllValues($arr) {
save_to_db($arr['id'], $arr['name'], $arr['is_master'], $arr['master_id']);
if ($arr['has_children']) {
array_map('saveAllValues, $arr['nodes']);
}
}