Creating a multi dimensional array - is there a better way than this
<p>I have this code</p>

<pre><code>        foreach ($objWorksheet-&gt;getRowIterator() as $row) {

            $output[] = array();

            //adding a blank array to the end doesn't seem to 
            //advance the array pointer so do it manually.
            $test = end($output); 

            $cellIterator = $row-&gt;getCellIterator();
            foreach ($cellIterator as $cell) {
                //specifically this bit
                $output[key($output)][] = $cell-&gt;getValue();
            }
        }
</code></pre>

<p>But I don't like how I've found the current key using</p>

<pre><code>$output[key($output)][] = $cell-&gt;getValue();
</code></pre>

<p>Is there a better approach?</p>
