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

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP chr() function usage and example

PHP String 字符串函数手册

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

Syntax

string chr ( int $ascii )

Definition and usage

It returns the specific character

Return value

 Returns the single character corresponding to the specified ascii.

Parameter

NumberParameters and description
1

ASCII

ASCII value

Online example

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

<?php
   echo chr(2)  .  \ // decimal value
   echo chr(05)  .  \ // octal value
   echo chr(0x2)  .  \ // hexadecimal value
?>
测试看看‹/›

PHP String 字符串函数手册