fork download
  1. <?php
  2.  
  3. $matriz = array();
  4.  
  5. $matriz[0][1] = '01';
  6. $matriz[0][2] = '02';
  7. $matriz[1][1] = '11';
  8. $matriz[1][2] = '12';
  9.  
  10. foreach ($matriz as $itens) {
  11. foreach ($itens as $item) {
  12. echo $item . "\n";
  13. }
  14. }
  15.  
  16. echo "Total: " . array_sum(array_map("count", $matriz)) . "\n";
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
01
02
11
12
Total: 4