(PHP 4, PHP 5)
chr — 返回指定的字符
$ascii
)
返回相对应于 ascii
所指定的单个字符。
Example #1 chr() 例子
<?php
$str = "The string ends in escape: ";
$str .= chr(27); /* 在 $str 后边增加换码符 */
/* 通常这样更有用 */
$str = sprintf("The string ends in escape: %c", 27);
?>
可以在此处找到 ASCII 码表:» http://www.asciitable.com。
ascii
The ascii code.
Returns the specified character.
Example #2 chr() example
<?php
$str = "The string ends in escape: ";
$str .= chr(27); /* add an escape character at the end of $str */
/* Often this is more useful */
$str = sprintf("The string ends in escape: %c", 27);
?>