YouTip LogoYouTip

Func String Chr

# PHP chr() Function [![Image 3: PHP String Reference Manual](#) PHP String Reference Manual](#) ## Example Return characters from different ASCII values: <?php echo chr(52) . "
"; // Decimal value echo chr(052) . "
"; // Octal value echo chr(0x52) . "
"; // Hex value ?> [Run Example Β»](#) * * * ## Definition and Usage The chr() function returns a character from a specified ASCII value. The ASCII value can be specified as a decimal, octal, or hexadecimal value. Octal values are defined with a leading 0, and hexadecimal values are defined with a leading 0x. * * * ## Syntax chr(_ascii_) | Parameter | Description | | --- | --- | | _ascii_ | Required. The ASCII value. | ## Technical Details | Return Value: | Returns the specified character. | | :--- | | PHP Version: | 4+ | * * * ## More Examples ## Example 1 Use octal value 046 to add the ASCII character: &. [Run Example Β»](#) ## Example 2 Use decimal values 43 and 61 to add the ASCII characters: + and =. [Run Example Β»](#) * * PHP String Reference Manual](#)
← Func String LcfirstFunc String Chop β†’