Return the ASCII value of "h":
<?phpecho ord("h")."<br>";echo ord("hello")."<br>";?>The ord() function returns the ASCII value of the first character in a string.
ord( string )
parameter | describe |
---|---|
string | Required. The string from which to obtain the ASCII value. |
Return value: | Returns the ASCII value as an integer. |
---|---|
PHP version: | 4+ |