title: Generate a matrix from an excel worksheet [ExcelBundle-Symfony]
body: <p>I made the follow function for get a matrix from a worksheet.</p>
  
  <pre><code>private function getMatrixFromSheet($worksheet){
      foreach ($worksheet-&gt;getRowIterator() as $row) {
          $cellIterator = $row-&gt;getCellIterator();
          $cellIterator-&gt;setIterateOnlyExistingCells(false);
          foreach ($cellIterator as $cell) {
              if (!is_null($cell)) {
                  $matrix[$cell-&gt;getRow()][$cell-&gt;getColumn()] = $cell-&gt;getCalculatedValue();
              }
          }
      }
      return $matrix;
  }
  </code></pre>
  
  <p>In this way if I want to access to the second row, second col cell, I can do <code>$matrix[2]['B']</code>.</p>
  
  <p>I need to be able to access to the matrix indexes both as number in order to access to the previous cell as <code>$matrix[2][2]</code>.</p>
  
  <p>Is there a way to do this?<br>
  I try to convert <code>$cell-&gt;getColumn()</code> result in a integer, but unfortunately <code>(int) "a" == 0</code></p>