PHP ord() Function

The ord() function in PHP converts the first byte of a string to a value between 0 and 255. This function interprets the binary value of the first byte of string as an unsigned integer.

Syntax

Parameter

string(required): This parameter represents a character.

Return

This function returns an integer between 0 and 255.

Example 1

Output

Example 2

Output

Example 3

Output

Pin It on Pinterest

Share This