Reputation: 12830
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, '.', '');
}
Upvotes: 2
Views: 1232
Reputation: 485
Simplest technique is nested Foreach look ... Like
foreach($arrD as $key => $arrInternal){
foreach($arrInternal as $keyIn => $Data){
//Perform your operation here
}
}
Upvotes: 4
Reputation: 160833
foreach ($d["T"] as &$var) {
$var['Pay'] = number_format($var['Pay'], 2, '.', '');
}
Upvotes: 3