I want to generate a list that carries an index with letters, for example: A.- list B.- list C.- list .... but if the list passes the letter Z that generates like this: AA.- list AB.- list AC.- list
I hope you can support me ... Greetings !!!!
I want to generate a list that carries an index with letters, for example: A.- list B.- list C.- list .... but if the list passes the letter Z that generates like this: AA.- list AB.- list AC.- list
I hope you can support me ... Greetings !!!!
This works simple and simple using recursion
function getExcelCol($num) {
$numero = $num % 26;
$letra = chr(65 + $numero);
$num2 = intval($num / 26);
if ($num2 > 0) {
return getExcelCol($num2 - 1) . $letra;
} else {
return $letra;
}
}
you do not have to worry about this anymore, PHP does what you want it to do
<?php
$miletra = "A";
for ($i =0; $i < 30; $i++){
echo $miletra."<br/>";
$miletra++;
}
?>