
7.序列化 你是否会把一个比较复杂的数据结构存到数据库或是文件中?你并不需要自己去写自己的算法。PHP早已为你做好了,其提供了两个函数:?serialize()和unserialize(): //一个复杂的数组 $myvar=array( 'hello', 42, array(1,'two'), 'apple' ); //序列化 $string=serialize($myvar); echo$string; /*输出 a:4:{i:0;s:5:"hello";i:1;i:42;i:2;a:2:{i:...