2014-09-29 71 views
1

我只是好奇,爲什麼行從1開始,列從0開始。有沒有什麼特別的理由,或者我錯過了一些重要的東西?爲什麼不只是從0或1開始(一致性)。PHPExcel行從1開始,列爲0

/** 
* Set a cell value by using numeric cell coordinates 
* 
* @param string $pColumn Numeric column coordinate of the cell (A = 0) 
* @param string $pRow Numeric row coordinate of the cell 
* @param mixed $pValue Value of the cell 
* @param bool $returnCell Return the worksheet (false, default) or 
    the cell (true) 
* @return PHPExcel_Worksheet|PHPExcel_Cell 
    Depending on the last parameter being specified 
*/ 
public function setCellValueByColumnAndRow($pColumn = 0, 
              $pRow = 1, 
              $pValue = null, 
              $returnCell = false) 
{ 
    $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValue($pValue); 
    return ($returnCell) ? $cell : $this; 
} 

回答

3

的原因是什麼後,原本是基於舊的PEAR SEW也有從零開始的列ID

一個錯誤的決定更早版本的向後兼容性