PHP functions: Master the applications of ord () and chr () functions. The third part of the Chinese character encoding Study Series, the PHP function section, master the application of the ord () and chr () functions, in the previous [PHP Basics],
The ord () function converts a character to a decimal number, and the chr () function converts a decimal number to a character. in binary, octal, the relationship between decimal and hexadecimal forms serves as a bridge between Chinese character
The ord () function converts a character to a decimal number, and the chr () function converts a decimal number to a character. in binary, octal, the relationship between decimal and hexadecimal forms serves as a bridge between Chinese character
Chinese character encoding Research series phase III, PHP function Chapter Master ord () and Chr () function application, in the previous period [PHP Basics of ASCII code comparison and character conversion] in the article to understand the ASCII
The third part of the Chinese character encoding Study Series, the PHP function section, master the application of the ord () and chr () functions, in the previous [PHP Basics], I learned about ASCII code and character conversion methods, but two
The third part of the Chinese character encoding Study Series, the PHP function section, master the application of the ord () and chr () functions, in the previous [PHP Basics], I learned about ASCII code and character conversion methods, but two
Ord
(PHP 4, PHP 5, PHP 7)
Ord-return ASCII value of character
Ord-the ASCII value of the returned character
Descriptionord($string)//Returns the ASCII value of the first character of string.//返回字符串 string 第一个字符的
The functions of these two functions are exactly the opposite of the CHR function, which returns characters from the specified ASCII value and the Ord () function returns the ASCII value of the first character of the string. Understand that this
Instance
Returns the ASCII value of "H":
"; Echo ord (" Hello ")." ";? >
Definition and usage
The Ord () function returns the ASCII value of the first character in a string.
Grammar
Ord (String)
Parameter description
string is required. The string
Chr, unichr, and ord can be used as character type conversion in Python. here we will talk about the comparison between chr, unichr, and ord character functions in Python, for more information, see chr, unichr, and ord. they can be used as character
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.