我们在使用PHP序列化/反序列化过程中遇到了一个奇怪的问题。我们已经将特定字符串序列化并存储在MySQL中(UTF-8字符集)。当尝试反序列化时,出现了错误。
例如: 字符串:
"Anoop did a great job cutting out pictures from the magazine that started with the letter P."
数据库中序列化数据:
s:96:"Anoop did a great job cutting out pictures from the magazine that started with the letter P.";
而在反序列化时,我们遇到了这个错误“Notice - unserialize (): Error at offset 2 of 101 bytes”。我们注意到字符串长度不同。这个问题的原因是什么?
非常感谢您的帮助!谢谢!
例如: 字符串:
"Anoop did a great job cutting out pictures from the magazine that started with the letter P."
数据库中序列化数据:
s:96:"Anoop did a great job cutting out pictures from the magazine that started with the letter P.";
而在反序列化时,我们遇到了这个错误“Notice - unserialize (): Error at offset 2 of 101 bytes”。我们注意到字符串长度不同。这个问题的原因是什么?
非常感谢您的帮助!谢谢!