ord(): the ASCII value of the first character in a given string
Get the byte value of the first character
ord() returns the numeric value of the first byte in a string. This works directly for single-byte ASCII characters; a multibyte UTF-8 character can occupy more than one byte.
$value = ord('A');
echo $value; // 65
For ASCII characters, the first byte matches the corresponding ASCII code. For example:
echoord('&');
The output is here
38
Use chr() to convert a byte value back to a character
Example 1: Getting ASCII Value of Special Characters