<?php function foo($content, $keys) { return sizeof($keys) === 0 ? $content : foo([array_pop($keys) => $content], $keys); } print_r(foo('bar', ['a', 'b', 'c', 'd', 'e']));
You have javascript disabled. You will not be able to edit any code.