PHP chr function
The function of the PHP chr function can be used to convert a specified ASCII code back to a character. The ASCII that the PHP chr function can convert includes octal , decimal, and hexadecimal. The converted characters may be graphics, symbols, or English letters, for example , the octet ASCII code of the @ symbol is 100. As long as you put 0100 into the parameter bit system of the chr function, you can convert the @ symbol. When ASCII was popular in the early years , the use of PHP chr function was very common, but now it is common Use Unicode instead of the traditional ASCII Code.
Basic syntax of PHP chr function
PHP chr function application example
echo chr(64).'<br>'; //output @
echo chr(0100).'<br>'; //output @
echo chr(0x40).'<br>'; //output @
echo chr(66).'<br>'; //output B
echo chr(0102).'<br>'; //output B
echo chr(0x42).'<br>'; //output B
? >
@
@
B
B
B
➤The ASCII Code query table of the two external websites of the " ASCII Code Table " on this site : ASCII-Wikipedia | Ascii Table
➤ The PHP chr function and the ord function are complementary, please refer to: PHP ord function .
Post a Comment
0 Comments