More String

uniqid([$s=””[,$b=false]]) returns a unique string with prefix $s. It is based on the current time (milliseconds). If $b is true, the unique string is 23 instead of 13 characters long.

RESETRUNFULL
<!DOCTYPE html><html><head></head>
<body><?php
echo uniqid("",true);
?></body></html>
pack($format, $m1,$m2……) returns a binary string which is made up of $m1, $m2…… packed in the specified format. The format string consists of format codes followed by an optional repeater argument, which can be either an integer or * for repeating to the end of the input data. unpack ($format,$s) returns an array of unpacked data by unpacking the binary string $s using the specified format. $format consists of format codes separated by a slash /. A key name for the array follows each format code.

Format codes
a NUL-padded string
A SPACE-padded string
h Hex string, low nibble first
H Hex string, high nibble first
c signed char
C unsigned char
s signed short(always 16 bit, machine byte order)
S unsigned short(always 16 bit, machine byte order)
n unsigned short(always 16 bit, big endian byte order)
v unsigned short(always 16 bit, little endian byte order
i signed int (machine dependent size and byte order)
I unsigned int (machine dependent size and byte order)
l signed long (always 32 bit, machine byte order)
L unsigned long (always  32 bit, machine byte order)
N unsigned long (always 32 bit, big endian byte order)
V unsigned long (always 32 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 absolution position
 

<!DOCTYPE html><html><head></head>
<body><?php

//stores the byte seq. 0x12, 0x34, 0x78, 0x56, 0x41, 0x42
$binarydata = pack("nvc*", 0x1234, 0x5678, 65, 66);

print_r(unpack("c2chars1/nint/c2chars2",$binarydata));

?></body></html>

Array ( [chars11] => 18 [chars12] => 52 [int] => 30806 
             [chars21] => 65 [chars22] => 66 )