- strtolower: documentation ( source)
- ord: documentation ( source)
<?php
$count = 1;
$col = 'A';
while ($count < 300) {
echo $count . ' = ' . $col . PHP_EOL;
if (isset($col[1])) {
echo (ord(strtolower($col[0])) - 96) * 26 + ord(strtolower($col[1])) . PHP_EOL;
} else {
echo ord(strtolower($col[0])) - 96 . PHP_EOL;
}
$col++;
$count++;
}