PHP chr() work: Here, we will find out about the chr() work with the example in PHP.
PHP chr() work
chr() work is utilized to get the character from a given ASCII code. ASCII value can be in decimal organization, octal configuration by following 0 (zero), and hexadecimal arrangement by following 0x.
Capacity acknowledges ASCII value in number and returns relating character.
Input: 65 Output: 'A' Input: 0x41 Output: 'A'
<?php echo (chr(65)."\n"); //ASCII value of 'A' in decimal echo (chr(0101)."\n"); //ASCII value of 'A' in octal echo (chr(0x41)."\n"); //ASCII value of 'A' in hex ?>
A A A