Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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, '.', ''); }
Simplest technique is nested Foreach look ... Like
foreach($arrD as $key => $arrInternal){ foreach($arrInternal as $keyIn => $Data){ //Perform your operation here } }
Add a comment
foreach ($d["T"] as &$var) { $var['Pay'] = number_format($var['Pay'], 2, '.', ''); }
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.