unserialize():偏移量为1个字节时出现错误

时间:2019-10-15 10:35:26

标签: php laravel

在反序列化序列化数据时出现此错误

  

unserialize():偏移量0为1个字节时出错

这是我的代码

$subcategorylisting = DB::table('subcategoryorders')->where('category_id',$category->id)->pluck('product_orderid');
$serialize_products = unserialize($subcategorylisting[0]);
$subcategorylisting = isset($subcategorylisting[0]) ? $subcategorylisting[0]:false;
if(isset($subcategorylisting)){
  $serialize_products = unserialize($subcategorylisting[0]);
  $serialize_productsS=implode(",",$serialize_products);
  $productlisting = \App\Productlisting::orderby(DB::raw('FIELD(id,'.$serialize_productsS.')'))->get();
}

0 个答案:

没有答案