php The ord function is used to return the ASCII value of "S". Its syntax is ord(string). The parameter string is required and refers to the string from which the ASCII value is to be obtained.
#How to use php ord function?
Definition and Usage
#ord() function returns the ASCII value of the first character of a string.
Syntax
ord(string)
Parameters
string Required. The string to obtain the ASCII value from.
Return value: Returns the ASCII value as an integer.
PHP Version: 4
Example
Return the ASCII value of "S":
<?php echo ord("S")."<br>"; echo ord("Shanghai")."<br>"; ?>
Output:
83 83
The above is the detailed content of How to use php ord function?. For more information, please follow other related articles on the PHP Chinese website!