Best way to list Alphabetical(A-Z) using PHP

前端 未结 11 2108
迷失自我
迷失自我 2020-12-13 13:33

I need to print/list alphabetical(A-Z) chararcters to manage Excel cells. Is there any PHP function to list alphabetic?

I need result as

A1
B1
C1
D1
..         


        
11条回答
  •  无人及你
    2020-12-13 13:50

    $len = 0;
    for ($char = 'A'; $char <= 'Z'; $char++) {
        $len++;
        if ($len == 26) {
            break;
        }
        echo $char;
    }
    

提交回复
热议问题