0

反序列化函数如何返回 false :

a:1:{i:0;a:2:{s:4:\"type\";s:6:\"isisbn\";s:2:\"id\";s:2:\" 85\";}}

代码:

        if (unserialize($stringTempList)) {
            return unserialize($stringTempList);
        }else{
            $this->messageBad[] = 'unserialize failed';
        }
4

1 回答 1

0

通过运行 stripslashes() 解决

代码:

    if (unserialize(stripslashes($stringTempList))) {
        return unserialize(stripslashes($stringTempList));
    }else{
        $this->messageBad[] = 'unserialize failed';
    }
于 2012-08-03T14:19:38.270 回答