如何 循环 字母 php,PHP-php循环打印a-z字母的疑惑
讀一下文檔吧:doc
PHP follows Perl's convention when dealing with arithmetic operations on character variables and not C's. For example, in PHP and Perl $a = 'Z'; $a++; turns $a into 'AA', while in C a = 'Z'; a++; turns a into '[' (ASCII value of 'Z' is 90, ASCII value of '[' is 91). Note that character variables can be incremented but not decremented and even so only plain ASCII characters (a-z and A-Z) are supported. Incrementing/decrementing other character variables has no effect, the original string is unchanged.
可以用這種方式:
for($i=97;$i<122;$i++){
echo chr($i).”n”;
}
或者:
for($i=ord(‘a’);$i
echo chr($i).”n”;
}
總結
以上是生活随笔為你收集整理的如何 循环 字母 php,PHP-php循环打印a-z字母的疑惑的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP盈亏问题,小升初数学必考经典应用题
- 下一篇: php项目安装器,php服务器环境安装及