serialize() 将数组转换为对象
unserialize () 将转换的数组还原
<code><span>$array</span> = <span>array</span>(); <span>$array</span>[<span>'key'</span>] = <span>'website'</span>; <span>$array</span>[<span>'value'</span>]=<span>'www.chhua.com'</span>; <span>$a</span> = serialize(<span>$array</span>); print_r(<span>$a</span>); <span>$b</span> = unserialize(<span>$a</span>); print_r(<span>$b</span>);</code>
得到结果如下
以上就介绍了php serialize与unserialize函数,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。