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
In mysql, the ASCII function converts characters into ascii code values. the following small series will introduce the usage and examples of ASCII functions in mysql to coders. For more information about coders, see. ASCII (str1)
Returns the ASCII
ASCII, GB2312, GBK, UTF-8 encoding:
Original address: HTTP://HI.BAIDU.COM/PHPEASE/ITEM/F450B5CAEC143014505058FC
variable naming rules:
1. Variable names are case-sensitive (case-sensitive).
2. Must begin with a letter or underscore. Variable
Analysis of ASCII and Unicode-encoded message writing files, asciiunicode
Abstr:]
ASCII and Unicode are two common character encodings. Their representation methods are different, so they must be differentiated in the program.
Based on the actual
One, ASCII (STR1)
Returns the ASCII code value of the leftmost character of the string str. If Str is an empty string, returns 0. If STR is NULL, return null
Example:1.
The code is as follows
Copy Code
Mysql> Select
Convert "Hello world!" to a hexadecimal value:
Definition and usage
The Bin2Hex () function converts a string of ASCII characters to a hexadecimal value. Strings can be converted back by using the pack () function.
Grammar
Bin2Hex
Php returns the ascii value function odr. In the php Tutorial, the odrord () function returns the ascii value of the first character of the string. Syntax ord (string) * $ strh; definition character $ resultord ($ str); request its ascii code echo
ASCII: The United States Standard Information Interchange code, is now the most common single-byte encoding system. Here is a simple understanding of what the code means. Coding is the process by which information transforms from one form or format
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
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.