Take advantage of PHP's ability to increment characters "perl-style"
$letters = array();
$letter = 'A';
while ($letter !== 'AAA') {
$letters[] = $letter++;
}
But you could also use simple integer values, and take advantage of PHPExcel's built-in PHPExcel_Cell::stringFromColumnIndex() method
EDIT
From PHP 5.5, you can also use Generators to avoid actually building the array in memory
function excelColumnRange($lower, $upper) {
++$upper;
for ($i = $lower; $i !== $upper; ++$i) {
yield $i;
}
}
foreach (excelColumnRange('A', 'ZZ') as $value) {
echo $value, PHP_EOL;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…