假设我有在具有“最终数据单元”的值,这是正确的方式来获得使用Zend的GData本小区(即A5)的索引表中单元格?
$query = new Zend_Gdata_Spreadsheets_CellQuery();
$query->setSpreadsheetKey($this->_spreadsheetKey);
$query->setWorksheetId($worksheet);
$cellFeed = $this->_spreadsheetService->getCellFeed($query);
foreach($cellFeed as $cellEntry) {
$row = $cellEntry->getCell()->getRow();
$col = $cellEntry->getCell()->getColumn();
$val = $cellEntry->getCell()->getText();
if ($val == 'last data cell'){ $index = array($row, $col); }
//echo "$row, $col = $val\n";
}
return $index;
我想以后使用$索引值作为一个界限来定义范围,像这样的例子:
$range = (string)$index[0]+1 + $index[1].":F20";
$contentAsCells = $worksheet->getContentsAsCells($range);
但指数值是数字。 我如何将其转换为“A1”格式? 谢谢