Table of Contents

Syntax

string chr(int $val)

(PHP 4, PHP 5)

$val ASCII value (integer) for the character result
RETURNS Returns the character which corresponds to the ASCII value

What it Does

This function converts an ASCII code (integer value) into the corresponding character. This is useful for creating characters which are unprintable or otherwise forbidden by the character set used on the source document.

Example

echo 'left arr = ' . chr(174);

Outputs:

left arr = «
 
chr.txt · Last modified: Apr 18, 2008 - 2:00pm (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki