biondo prova così allora

Codice PHP:
<?php
foreach($array as $root)
  {
  if (
is_array($root)) $sotto=true;
  else                 continue;
  
  
$track=array();
  while (
$sotto==true)
    {
    
$the_arr=$root;
    foreach(
$the_arr as $key=>$val)
      {
      if (
$key == "name" && isset($the_arr[$val]))
        {
        
$root=$the_arr[$val];
        
$track[]=$val;
        break;
        }
      else 
$sotto=false;
      }
    }
  
$end_track=implode('-',$track);
  echo 
$end_track;
  }
?>