PHP - ord
Trieda
Metóda - ord
The ord() function is used to get the extended ASCII code of the
first character of a string.
Note:To get the character of a specified extended ASCII code
use the chr() function.
Procedurálne
- function ord () : void
Parametre
ŽiadneMávratovej hodnoty
Returns the ASCII code of the first character of the string.
Príklady
<?php
echo 'A\'s code: ' . ord('A');
echo '<br>';
echo 'Z\'s code: ' . ord('Z');
echo '<br>';
echo 'The distance between A and Z is ' . (ord('Z') - ord('A')) . ' characters.';
