如何找到pack()-ed二进制数据的格式并解压缩它

I have stored binary data in Mysql field like this: 0x31 and 0x31303030303332 . this was converted to binary data from string, I don't know that string and I don't know how string had converted to this binary data. As far as I know the pack() and unpack() PHP functions can help me, BUT I can't convert back this binary data to string because I don't know what format (second argument of unpack() function) had been used. How can I find correct format to add in unpack('format', $mybinarystring) function? Or may be this can be converted back via another function or method?

There is no way to definitely find out which format is used to create the binary data, because its just binary data. You can guess, look at the content and find a hint, or just try&error.