Return the ASCII value of "h":
<?php
echo ord("h")."<br>";
echo ord("hello")."<br>";
?>
Try it Yourself »
The ord() function returns the ASCII value of the first character of a string.
ord(
string)
Parameter | Description |
---|---|
string | Required. The string to get an ASCII value from |
Return Value: | Returns the ASCII value as an integer |
---|---|
PHP Version: | 4+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!