PHP chr() Function

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

Syntax

string chr(ascii);

chr() Function Parameter

ParameterDescription
ascii :Required parameter. The extended ASCII code.

chr() Function Return Value

Return Value :Returns the specified character.

chr() Function Example

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