PHP chr() Function

The chr() function returns a character from the specified ASCII value.

Returns a one-character string containing the character specified by ascii.This function complements ord().

string chr ( int $ascii )

The ASCII value can be specified in decimal, octal, or hex values. Octal values are defined by a leading 0, while hex values are defined by a leading 0x.

Example -

Example #1 chr() example

Parameters

ascii

The extended ASCII code.

Values outside the valid range (0..255) will be bitwise and'ed with 255, which is equivalent to the following algorithm:

Returns the specified character.