为什么unserialize函数返回false:
一个:1:{I:0;一个:2:{S:4:\ “类型\”; S:6:\ “isisbn \”; S:2:\ “ID \”; S:2 :\ “85 \”;}}
代码:
if (unserialize($stringTempList)) {
return unserialize($stringTempList);
}else{
$this->messageBad[] = 'unserialize failed';
}
答案 0 :(得分:0)
通过运行stripslashes()
解决代码:
if (unserialize(stripslashes($stringTempList))) {
return unserialize(stripslashes($stringTempList));
}else{
$this->messageBad[] = 'unserialize failed';
}