Foreach (multi dimensional array) | SoloLearn: Learn to code for FREE!


Foreach (multi dimensional array)

How to iterate over multi dimensional array in php foreach ???. 2d and 3d arrays will be enough for your answer.

6/11/2020 5:13:57 AM


3 Answers

New Answer


This is the solution: <?php $my_array = [[1,2,3],[4,5,6]]; foreach($my_array as $data){ foreach($data as $number){ echo $number."<br/>"; } } ?>


Me&You you are welcome


Thank you for your help.