ord

(PHP 3, PHP 4 )

ord -- 文字のASCII値を返す

説明

int ord ( string string)

string の先頭文字のASCII値を返します。 この関数は chr() と逆の動作をします。

例 1 ord() の例

if (ord ($str) == 10) {
    echo "\$str の先頭は改行文字です。\n";
}


ASCIIテーブルを http://www.asciitable.com で参照可能です。

chr() も参照下さい。