php不同形式的实现a-z的26个字母的输出
直接上代码:
for($i=ord('a'), $n=ord('z'); $i<=$n; $i++){ echo chr($i),PHP_EOL; } echo PHP_EOL; $char = 'a'; while($char != 'aa'){ echo $char,PHP_EOL; $char++; } echo PHP_EOL; foreach(range('a','z') as $char){ echo $char,PHP_EOL; }