English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP chr() Function Usage and Example

PHP String Character String Functions Manual

The chr() function is used to return the specified character

Syntax

string chr ( int $ascii )

Definition and usage

It returns a specific character

Return value

 Returns the single character corresponding to the specified ascii.

Parameter

NumberParameters and descriptions
1

ASCII

ASCII value

Online example

Try the following example, returning characters from different ASCII values:

<?php
   echo chr(2) . "<br>"; // Decimal value
   echo chr(05) . "<br>"; // Octal value
   echo chr(0x2) . "<br>"; // Hexadecimal value
?>
Test and see‹/›

PHP String Character String Functions Manual