出现的问题 从数据库中取出数据后进行反序列化后,php报错 unserialize(): Error at offset xx of xx bytes; 解决方案 function _unserialize($str) { return preg_replace_callback('#s:(\d+):"(.*?)";#s',function($match){return 's:'.strlen($match[2]).':"'.$match[2].'";';},$str); }