Home  >  Article  >  Backend Development  >  What does ord mean in php

What does ord mean in php

WBOY
WBOYOriginal
2022-02-14 14:19:584475browse

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)".

What does ord mean in php

The operating environment of this tutorial: windows10 system, PHP7.1 version, DELL G3 computer

What does ord mean in php

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:

What does ord mean in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn