1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > ord函数 chr函数_PHP chr()函数与示例

ord函数 chr函数_PHP chr()函数与示例

时间:2020-12-08 01:03:53

相关推荐

ord函数 chr函数_PHP chr()函数与示例

ord函数 chr函数

PHP chr()函数 (PHP chr() function)

chr() functionis used to get the character from a given ASCII code. ASCII value can be in decimal format, octal format by following 0 (zero), and hexadecimal format by following 0x.

chr()函数用于从给定的ASCII码获取字符。 ASCII值可以是十进制格式,八进制格式(跟随0 (零))和十六进制格式(跟随0x) 。

Syntax:

句法:

chr(ASCII_value);

Function accepts ASCII value in number and returns corresponding character.

函数接受数字形式的ASCII值并返回相应的字符。

Examples:

例子:

Input: 65Output: 'A'Input: 0x41Output: 'A'

PHP code:

PHP代码:

<?phpecho (chr(65)."\n"); //ASCII value of 'A' in decimalecho (chr(0101)."\n"); //ASCII value of 'A' in octalecho (chr(0x41)."\n"); //ASCII value of 'A' in hex?>

Output

输出量

AAA

翻译自: /php/chr-function-with-example.aspx

ord函数 chr函数

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。