Home >Backend Development >PHP Tutorial >php serialize and unserialize functions
serialize() Convert array to object
unserialize () restore the converted array
<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>
and get the result as follows
The above introduces the php serialize and unserialize functions, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.