Home > Article > Backend Development > What does ord mean in php
In PHP, ord is an ordinal function, which means "getting the ASCII value". The ord function can return the ASCII value of the first character in the string. The returned result is the specified character in the ASCII code. Serial number, the syntax is "ord(string)".
The operating environment of this tutorial: windows10 system, PHP7.1 version, DELL G3 computer
ord() function returns the ASCII value of the first character in a string.
Syntax
ord(string)
Parameter Description
string Required. The string from which to obtain the ASCII value.
Return value: Returns the ASCII value in integer form.
The example is as follows:
<?php echo ord("h")."<br>"; echo ord("hello")."<br>"; ?>
Output result:
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What does ord mean in php. For more information, please follow other related articles on the PHP Chinese website!