php triple loop

Download Raw Clone


  1. <?php
  2. $arr = [
  3. [
  4. [12, 23, 45, 56, 78],
  5. [12, 23, 45, 56, 78],
  6. [12, 23, 45, 56, 78],
  7. ],
  8. [
  9. [12, 23, 45, 56, 78],
  10. [12, 23, 45, 56, 78],
  11. [12, 23, 45, 56, 78],
  12. ],
  13. [
  14. [12, 23, 45, 56, 78],
  15. [12, 23, 45, 56, 78],
  16. [12, 23, 45, 56, 78],
  17. ]
  18. ];
  19. for($i = 0; $i < 3; $i++){
  20. for($j = 0; $j < 3; $j++){
  21. for($k = 0; $k < 5; $k++){
  22. echo $arr[$i][$j][$k];
  23. echo " ";
  24. }
  25. echo "<br>";
  26. }
  27. }
  28. ?>

Raw paste data: