PHP chr() Function

Last Updated:

PHP chr()

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

Example

PHP Compiler
<?php echo chr(65) . "<br>"; // Decimal value echo chr(065) . "<br>"; // Octal value echo chr(0x65) . "<br>"; // Hexadecimal value ?>

Syntax

chr(ascii_code)

Parameter Values

ValueTypeExplanation
ascii_code Required Specifies the ascii code.

Return Value

ValueExplanation
string Returns a character from the specified ASCII Code.

Share this Page

Meet the Author