RangeToArray strange array keys

Topics: Developer Forum
Apr 23, 2011 at 6:18 PM

Hi guys,

I am using an Excel2007 reader to extract values from a range.
The last argument of the rangeToArray function is set to false to prevent generating keys based on the actual rows.
$a = $objPHPExcel->getActiveSheet()->rangeToArray("D56:H59","",false,false,false);

However I get the following array:

array(4) { [55]=> array(5) { [0]=> float(1) [1]=> float(5) [2]=> float(9) [3]=> float(13) [4]=> float(17) } [56]=> array(5) { [0]=> float(2) [1]=> float(6) [2]=> float(10) [3]=> float(14) [4]=> float(18) } [57]=> array(5) { [0]=> float(3) [1]=> float(7) [2]=> float(11) [3]=> float(15) [4]=> float(19) } [58]=> array(5) { [0]=> float(4) [1]=> float(8) [2]=> float(12) [3]=> float(16) [4]=> float(20) } } Array ( [55] => Array ( [0] => 1 [1] => 5 [2] => 9 [3] => 13 [4] => 17 ) [56] => Array ( [0] => 2 [1] => 6 [2] => 10 [3] => 14 [4] => 18 ) [57] => Array ( [0] => 3 [1] => 7 [2] => 11 [3] => 15 [4] => 19 ) [58] => Array ( [0] => 4 [1] => 8 [2] => 12 [3] => 16 [4] => 20 ) )

This brings up 2 questions:
1. Why do I still get 55 - 58 returned as keys in the first array dimension?
2. Why are the values 55-58 if I passed the range D56:H59 to the formula?

Johan

Coordinator
Apr 28, 2011 at 9:39 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Apr 29, 2011 at 11:36 AM

Problem fixed in SVN code