Funções PHP |
. Glossários Funções PHP - chr ( ) |
(PHP 3, PHP 4 , PHP 5)
chr -- Retorna um caracter específico
string chr ( int ascii)
Retorna uma string de um único caractere contendo o caracter especificado pelo ascii.
Exemplo:
Uso do chr()
<?php
$str = "The string ends in escape: ";
$str .= chr(27); /* add an escape character at the end of $str
*/
/* Often this is more useful */]
$str = sprintf("The string ends in escape: %c", 27);
?>
Você pode encontrar uma tabela ASCII-table aqui: http://www.asciitable.com.
Esta função complementa ord().
Veja também sprintf() com
uma string no formato de %c.