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

chr() function in php

Last Updated by Pooja Chikara

0 2131

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:





Best WordPress Hosting


Share:

SSL for business, from $12.88


Leave a Reply


Comments
    Waiting for your comments

Coding Tag WhatsApp Chat
Coding Tag WhatsApp Chat