参考chr()跟ord()这两个函数
也许就有你要的答案

解决方案 »

  1.   

    chr
    返回指定的字符 (PHP 3, PHP 4, PHP 5) string chr ( int ascii )描述
    返回相对应于 ascii 所指定的单个字符。 
      

  2.   

    string chr ( int ascii )
    返回相对应于 ascii 所指定的单个字符。 例子 1. chr() 示例<?php
    $str = "The string ends in escape: ";
    $str .= chr(27); /* 在 $str 后边增加换码符 *//* 通常这样更有用 */$str = sprintf("The string ends in escape: %c", 27);
    ?>  
     ord
    (PHP 3, PHP 4, PHP 5)ord -- Return ASCII value of character
    Description
    int ord ( string string )
    Returns the ASCII value of the first character of string. This function complements chr(). 例子 1. ord() example<?php
    $str = "\n";
    if (ord($str) == 10) {
        echo "The first character of \$str is a line feed.\n";
    }
    ?>  
     
    You can find an ASCII-table over here: http://www.asciitable.com. See also chr().