|
|
Tutorials » Php »
|
Topic |
What is ord Function and how it is used in string?
|
|
Explanation |
|
The ord function returns the ASCII value of a character in PHP.
Syntax:
ord(string)
The syntax returns the ASCII value of the first character of the string.
Example:
<?php
echo ord("HIOX")."<br/>";
echo ord("I")."<br/>";
?>
Result:
72
73
In the above example the ASCII values of the strings "HIOX" and "I" are returned.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|