Home > Backend Development > PHP Problem > What does ord mean in php

What does ord mean in php

WBOY
Release: 2023-03-15 10:32:01
Original
4715 people have browsed it

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)
Copy after login

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>";
?>
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template