serialize()
<?php $a = array('a' => 'as' ,'b' => 'bs' , 'c' => 'cs'); //序列化数组 $s = serialize($a); echo $s; //输出结果:a:3:{s:1:"a";s:5:"as";s:1:"b";s:6:"bs";s:1:"c";s:7:"cs";} ?>