例如,我正在寻找一个不断增加字母的函数以“aaaaaa”开头并转到“aaaaab”并以“zzzzzz”结尾
问问题
112 次
2 回答
2
使用 PHP 增加字符的能力Perl 风格
$char = 'aaaaaa';
$endChar = 'zzzzzz';
$endChar++;
while ($char != $endChar) {
echo $char++, PHP_EOL;
}
于 2013-05-26T17:56:09.240 回答
0
只需使用增量运算符
$start = "aaaaaa";
$end = "zzzzzz";
while($start ++ != $end) {
// print after every 10,000,000 million
(@$i ++ % 10000000 == 0) and print($start . PHP_EOL);
}
echo "Total ", number_format($i, 0);
输出
aaaaab
avwyxl
brtxuv
cnqwsf
djnvpp
efkumz
fbhtkj
fxesht
gtbrfd
hoyqcn
ikvozx
jgsnxh
kcpmur
kymlsb
lujkpl
mqgjmv
nmdikf
oiahhp
pdxgez
pzufcj
qvrdzt
rrocxd
snlbun
tjiarx
ufezph
vbbymr
vwyxkb
wsvwhl
xosvev
ykpucf
zgmszp
Total 308,915,775
于 2013-05-26T17:56:10.480 回答