$s = encode('UTF-16LE', "first name string\0").encode('UTF-16LE', "middle name string\0"). encode('UTF-16LE', "last name string\0").pack('V', 3654877182).pack('V', 1).encode('UTF-16LE', "address string\0")."zip code ascii\0".pack('V',1); $decodedStr = decode('UTF-16LE', $s, Encode::FB_CROAK); print Dumper([unpack('Z*Z*Z*VVZ*Z*V',$decodedStr)]); #### $VAR1 = [ "first name string", "middle name string", "last name string", "1627454973", "1701995620", "ss string", "\x{697a}\x{2070}\x{6f63}\x{6564}\x{6120}\x{6373}\x{6969}\x{100}" ];