abbr.ordained (law, etc.) stipulated; order; ordinary; ordinal sequence

php ord() function syntax

Function: Returns the ASCII value of the first character of the string.

Syntax: ord(string)

Parameters:

Parameter Description
stringRequired, the string from which the ASCII value is to be obtained

Description: Returns the ASCII value of the first character of the string.

php ord() function example

<?php
echo ord("Hello world");
?>

Run instance»

Click the "Run instance" button to view the online instance

Output:

72
<?php
echo ord("i'm study in php.cn");
?>

Run Instance»

Click the "Run Instance" button to view the online instance

Output:

105