PHP - chr
Trieda
Metóda - chr
(PHP 4, PHP 5, PHP 7)
The chr() function is used to get a character by its ASCII
code.
Note:To get the ASCII code of a character use the
ord() function.
Procedurálne
- function chr (int $ascii) : string
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $ascii | int | The extended ASCII code (0 to 255). |
Mávratovej hodnoty
Vracia: string
Returns the character at the given position in the extended ASCII table.
Príklady
<?php
$character = 65; // 65 = A
echo chr($character + 5); // A + 5 = F
echo chr($character + 25); // A + 25 = Z
