PHP ord() Function


The ord() function is used to returns the ascii value of first character in a string.

Syntax
ord(string)
Parameters
  • string - (Required) Specify the string to get ASCII value from.
Example
<?php
   echo ord("Hii");
?> 

Output

104
Example
<?php
   echo ord("Ram")."<br>";
   echo ord("Good Morning");
?> 

Output

82
72

Prev Next