PHP chr() Function

PHP chr() function returns a one-character string containing the character specified by ASCII. Alias of rtrim().


string chr(ascii);

chr() Function Parameter

ascii :Required parameter. The extended ASCII code.

chr() Function Return Value

Return Value :Returns the specified character.

chr() Function Example

// Decimal value
echo chr(12) . "<br>"; 
// Octal value
echo chr(032) . "<br>"; 
// Hex value
echo chr(0x12) . "<br>";