如何在php中使用foreach for 3d数组

I have a 3d array and needs to do something with it, was able to solve the problem using simple for each like this:

for($n=0;$n<count($d["T"]);$n++)
{
 $d["T"][$n]["Pay"]=number_format($d["T"][$n]["Pay"], 2, '.', '');
}
foreach ($d["T"] as &$var) {
  $var['Pay'] = number_format($var['Pay'], 2, '.', '');
}

Simplest technique is nested Foreach look ... Like

foreach($arrD as $key => $arrInternal){

    foreach($arrInternal as $keyIn => $Data){

          //Perform your operation here
    }

}