PHP Pack and Unpack Touch Board character meaning _php skill

Source: Internet
Author: User
Tags pack unpack
Possible values for the format parameter:
a-nul-padded string
a-space-padded string
H-hex string, low nibble-a
H-hex string, high nibble-a
c-signed Char
c-unsigned Char
s-signed short (always bit, machine byte)
s-unsigned short (always bit, machine byte)
n-unsigned short (always bit, big endian byte)
v-unsigned short (always bit, little endian byte)
i-signed integer (Machine dependent size and byte order)
i-unsigned integer (Machine dependent size and byte order)
L-signed long (always bit, machine byte order)
L-unsigned long (always bit, machine byte order)
N-unsigned long (always bit, big endian byte)
V-unsigned long (always bit, little endian byte order)
F-float (Machine dependent size and representation)
D-double (Machine dependent size and representation)
X-nul byte
X-back up one byte
@-Nul-fill to absolute position
A a filled-empty byte string
A a byte string filled with spaces
b A bit string, in which the order of bits in each byte is ascending
b A bit string, in which the order of the bits in each byte is descending
c A signed char (8-bit integer) value
c A unsigned char (8-bit integer) value; about Unicode see u
D-Native format double-precision floating-point number
F single-precision floating-point number in native format
h a hexadecimal string, low four bits in front
h a hexadecimal string, high four bits in front
I a signed integer value, native format
I a unsigned integer value, native format
L A signed long plastic, always 32-bit
L An unsigned long shaping, always 32-bit
N A 16-bit short shaping, "Network" byte order (big head in front)
N A 32-bit short shaping, "Network" byte order (big head in front)
p A pointer to a string that points to an empty end
p A pointer to a fixed-length string
Q A signed four times-fold (64-bit integer) value
Q A unsigned four times-fold (64-bit integer) value
s a signed short integer value, always 16 bits
s an unsigned short integer value, always 16 bits, and the byte sequence is related to the machine chip.
U a code-free string
U a Unicode character number
V A 16-bit short integer with a "VAX" byte order (front end)
V A 32-bit short integer with a "VAX" byte order (front end)
W A ber-compressed integer
X an empty byte (ignoring one byte forward)
X back up one byte
Z a null-terminated (and empty-filled) byte string
Rules:
1. Each letter can be followed by a number that represents count (count), if Count is a * represents the rest of the things.
2. If you provide fewer parameters than $format requirements, the pack assumes that the missing values are null. If you provide more arguments than $format, then the extra parameters are ignored.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.