Home > Article > Backend Development > How to use php chr function
PHP chr function is used to return the specified character, that is, return the character from the specified ASCII value. The syntax is chr(ascii), the parameter ascii is required, that is, the ASCII value is specified.
#What does the chr function mean? How to use php chr function?
php chr() function Syntax
Function: Return characters from the specified ASCII value.
Syntax:
chr(ascii)
Parameters:
ascii Required, specify the ASCII value
Description: The chr() function returns characters from the specified ASCII value. ASCII values can be specified as decimal, octal, or hexadecimal values. Octal values are defined with leading 0, and hexadecimal values are defined with leading 0x.
php chr() function usage example:
<?php echo chr(82) . "<br>"; // 十进制 echo chr(062) . "<br>"; // 八进制值 echo chr(0x42) . "<br>"; // 十六进制值 ?>
Output:
R 2 B
This article is an introduction to the PHP chr function. I hope it will help you if you need Friends help!
The above is the detailed content of How to use php chr function. For more information, please follow other related articles on the PHP Chinese website!