php 获取下一个字母,该怎么处理

WBOY
Release: 2016-06-13 13:47:12
Original
1100 people have browsed it

php 获取下一个字母
如给出一个字母“B”,怎么样得到它的下个字母“C”呢?PHP有没有现成的函数可调用呢?

------解决方案--------------------
现成的函数不清楚,
如果是26个英文字母的固定排序下的下一个字母,用数组相关的函数可以实现吧?
------解决方案--------------------
现成的函数不知道有不有? 等高人来答。

PHP code

$a=ord('B'); 
echo chr($a+1);
<br><font color="#e78608">------解决方案--------------------</font><br>
Copy after login
探讨

$s = 'B';
echo ++$s;//out C
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template