Current Location: Home> Function Categories> ord

ord

Convert the first byte of the string to a value between 0-255
Name:ord
Category:String
Programming Language:php
One-line Description:Returns the ASCII value of the first character in the string.

Definition and usage

ord() function returns the ASCII value of the first character of the string.

Example

Returns the ASCII value of "S":

 <?php
echo ord ( "S" ) . "<br>" ;
echo ord ( "Shanghai" ) . "<br>" ;
?>

Try it yourself

grammar

 ord ( string )
parameter describe
string Required. A string to get the ASCII value from it.
Similar Functions
Popular Articles