2

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, '.', ''); } 
0

2 Answers 2

4

Simplest technique is nested Foreach look ... Like

foreach($arrD as $key => $arrInternal){ foreach($arrInternal as $keyIn => $Data){ //Perform your operation here } } 
Sign up to request clarification or add additional context in comments.

Comments

3
foreach ($d["T"] as &$var) { $var['Pay'] = number_format($var['Pay'], 2, '.', ''); } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.