chr() function in PHP || PHP chr() function

chr() function in php

Last Updated by Pooja Chikara 27-Apr-20

0 345


PHP chr() function is used to returns characters corresponding to given ASCII values. It is an inbuilt function of PHP. The return type of this function is character means it returns characters.

Syntax:

chr($ascii_code);

here,

$ascii_code represents an ASCII value.


Example:

<?php
echo chr(96) . "<br>"; // return single quote
echo chr(040) . "<br>"; // return whitespace
echo chr(47) . "<br>";  // return division
?>

Output:

chr() function in php



Share:


Leave a Reply


Comments
    Waiting for your comments