September 2001
Intermediate to advanced
768 pages
32h 45m
English
string chr(int ascii_code) Gets the character for a given ASCII code.
Returns:
ASCII character; NULL if the given integer is not a valid ASCII code
Description:
chr() returns the character associated with the supplied ASCII code. If the integer provided is not a valid ASCII code, the function returns nothing.
Note that the integer can be specified in octal or hex values, as well as decimal. Octal values are denoted by a leading 0 (07, 012, ...), while hex values are denoted by a leading 0x (0xFF, 0x9D, ...).
Version:
PHP 3+, PHP 4+
See also:
Other functions that deal with the ASCII value of a character:
bin2hex() ord() pack() printf() sprintf() unpack()
Examples:
$string .= chr (0); |
Read now
Unlock full access