Blog : PHP ord() Function

PHP ord() Function


--------------------------------------------------------------------------------

 Complete PHP String Reference

--------------------------------------------------------------------------------

Definition and Usage
The ord() function returns the ASCII value of the first character of a string.

Syntax
ord(string)  

Parameter Description
string Required. The string to get an ASCII value from


--------------------------------------------------------------------------------

Example
echo ord("h")."
";
echo ord("hello")."
";
?>  

The output of the code above will be:

104
104