<?php $a = array('a' => 'Apple' ,'b' => 'banana' , 'c' => 'Coconut'); //序列化数组 $s = serialize($a); echo $s; //输出结果:a:3:{s:1:"a";s:5:"Apple";s:1:"b";s:6:"banana";s:1:"c";s:7:"Coconut";} echo '<br /><br />'; //反序列化 $o = unserialize($s); print_r($o); //输出结果 Array ( [a] => Apple [b] => banana [c] => Coconut ) ?>