ord

PHP 4, PHP 5, PHP 7, PHP 8
ord - Convert the first byte of a string to a value between 0 and 255
Ord Online Tool
Manual
Code Examples

Example #1 Examining the individual bytes of a UTF-8 string

Result: Byte 0 of $str has value 240 Byte 1 of $str has value 159 Byte 2 of $str has value 144 Byte 3 of $str has value 152
PHP Version:

Example #2 ord example

PHP Version:


Example #3 of ord

PHP Version:


Function ord:

Strings Functions

Most used PHP functions