0

When try to unserialize data get this error :

WARNING: Error at offset 221 of 541 bytes

Data :

    a:1:{i:0;a:20:{s:5:"tedad";s:1:"6";s:9:"basketRow";s:2:"23";s:2:"id";s:2:"16";s:5:"title";s:33:"گوشی سامسونگ مدل 34";s:5:"price";s:4:"2000";s:3:"cat";s:1:"1";s:12:"introduction";s:23:"<p>توضیحات</p>
";s:12:"tedad_mojood";s:2:"10";s:8:"discount";s:2:"20";s:7:"special";s:1:"0";s:12:"time_special";s:1:"0";s:13:"onlyclicksite";s:1:"0";s:5:"viewd";s:1:"0";s:6:"colors";s:3:"2,3";s:8:"garantee";s:1:"1";s:10:"idcategory";s:1:"0";s:6:"weight";s:2:"40";s:10:"colorTitle";N;s:13:"garanteeTitle";N;s:13:"discountTotal";i:2400;}}

i checked this site and get the same error PHP Compiler but this site PHP Complier return unserialize data.

How can fixed Error

  • That's due to the multi-byte characters in your string, the length for that field is actually incorrect. See the [this question](https://stackoverflow.com/questions/2853454/php-unserialize-fails-with-non-encoded-characters) and especially the answer by @David on that one to solve your problem. – ccKep Nov 26 '17 at 04:55
  • i checked all solutions, don't work –  Nov 26 '17 at 05:12
  • [It doesn't?](https://3v4l.org/0rdN8) (as a comparison: [this](https://3v4l.org/RBIaE) is the non-working version without `mb_unserialize()`) – ccKep Nov 26 '17 at 05:14
  • Thanks, it's ok. –  Nov 26 '17 at 07:13

0 Answers0