简体   繁体   English

PHP序列化/反序列化错误

[英]PHP serialize / unserialize ERROR

i want to save an array in my database and want to turn it back to in array when I output it from my database. 我想在我的数据库中保存一个数组,并在我从数据库中输出它时将其转回到数组中。 For this I used the following code: 为此,我使用了以下代码:

$string = base64_encode(serialize($_SESSION['warenkorb']));

$array = unserialize(base64_decode($zeile['b_warenkorb']));

I always get the following error: 我总是收到以下错误:

Notice: unserialize(): Error at offset 72 of 75 bytes

I used a multidimensional array for this. 我为此使用了多维数组。

I hope someone could help me. 我希望有人可以帮助我。 would be nice :) 会好的 :)

The solution is, that the column length wasnt long enough. 解决方案是,列长度不够长。 I used 200 chars, but it needed many more. 我用了200个字符,但还需要更多。 Thanks @Federkun 谢谢@Federkun

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM