PHP chr

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : chr() function

Description

The chr() function is used to get a single character string from the specified ASCII value.

Version

(PHP 4 and above)

Syntax

chr(ascii_code)

Parameter

Name

Description

Required /
Optional

Type

ascii_code

The specified ascii_code.

Required

Integer

Return values

A one-character string containing the character specified by ascii _code

Value Type : String.

Pictorial Presentation

php-string-chr()

Example :

  1. $string_name1='w3resource';  

  2. $string_name2='com';  

  3. $asci_code=chr(46);  

  4. echo $string_name1 .$asci_code . $string_name2;  

  5. ?>  

Output :

w3resource.com