php生成a-z的数组
时间: 2023-12-18 16:02:15 浏览: 215
php中生成随机密码的自定义函数代码
你可以使用 range 函数来生成一个包含 a-z 字符的数组,如下所示:
```
$letters = range('a', 'z');
print_r($letters);
```
输出结果为:
```
Array
(
[0] => a
[1] => b
[2] => c
[3] => d
[4] => e
[5] => f
[6] => g
[7] => h
[8] => i
[9] => j
[10] => k
[11] => l
[12] => m
[13] => n
[14] => o
[15] => p
[16] => q
[17] => r
[18] => s
[19] => t
[20] => u
[21] => v
[22] => w
[23] => x
[24] => y
[25] => z
)
```
阅读全文