我需要编写一个函数,通过字母表其中迭代(AZ)所示: (下面是一个例子了-C)
I need to write a function which iterates through alphabet (a-z) like this: (here is an example for a-c)
a
b
c
aa
ab
ac
ba
bb
bc
ca
cb
cc
aaa
aab
aac
... and so on. (until the word has 5 characters)
任何想法如何做到这一点?我想我需要一些递归函数。
any idea how to do this? I guess I need some recursive function.
无需递归!
for($char = 'a'; $char != 'aaaaaa'; $char++){
echo $char . PHP_EOL;
}