foreach($matrix_detail as $val){
  foreach($val as $item){
    echo $item; 
  }
}

解决方案 »

  1.   

    echo '<table>';
    echo '<tr>';
    do {
      if($k) {
        echo '<td></td>';
        foreach($matrix_detail['x'] as $col)
          echo "<td>$col</td>";
        echo '</tr>';
      }else {
        foreach($matrix_detail['y'] as $row) {
          echo "<tr><td>$row</td>";
          foreach($matrix_detail['x'] as $col)
            echo "<td>O</td>";
          echo '</tr>';
        }
      }
    }while($k--);
    echo '<table>';