foreach ($arr as $key => $value) {
$path = explode($delim, $key);
$node = &$result;
while (count($path) > 1) {
$key = array_shift($path);
if (!isset($node[$key])) {
foreach ($arr as $key => $value) {
$path = explode($delim, $key);
$node = &$result;
while (count($path) > 1) {
$key = array_shift($path);
if (!isset($node[$key])) {