有同学问了一个问题:
复制代码 代码如下:
for($i = 'A'; $i echo $i;
}
//输出是啥?
复制代码 代码如下:
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARAS…….
复制代码 代码如下:
PHP follows Perl's convention when dealing with arithmetic operations on character variables and not C's. For example, in Perl ‘Z'+1 turns into ‘AA', while in C ‘Z'+1 turns into ‘[‘ ( ord(‘Z') == 90, ord(‘[‘) == 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.
复制代码 代码如下:
$name = "laruence";
++$name; //将会是"laruencf"
复制代码 代码如下:
$name = "laruence";
--$name; //没有影响, 还是"laruence"
以上就介绍了js截取字符串 PHP下对字符串的递增运算代码,包括了js截取字符串方面的内容,希望对PHP教程有兴趣的朋友有所帮助。