PHP如何将数据附加到序列化数组中如何将、组中、序列化、数据

由网友(哑笑)分享简介:If I have a serialized array... how can I append more values to it? Should I unserialize it first -> add data and then serialize it again? 解决方案 Yes.function add...

If I have a serialized array... how can I append more values to it? Should I unserialize it first -> add data and then serialize it again?

解决方案

Yes.

function addItem($serializedArray, $item)
{
   $a = unserialize($serializedArray);
   $a[] = $item;
   return serialize($a);
}
使用Jackson对JSON数据序列化与反序列化 04

阅读全文

相关推荐

最新文章