非常方便~讲数组序列化存入数据库在取出简直方便极了~

function actiontest(){
        $unserialize = array(
            array(
                'id' => 1,
                'title' => "时间",
                'img' => "time.jpg",
            ),
            array(
                'id' => 1,
                'title' => "金钱",
                'img' => "money.jpg",
            )
        );
        $serialize = serialize($unserialize);
        echo $serialize;

        $unserialize = unserialize($serialize);

        function pre($str) {
            echo '<pre>';
            var_dump($str);
            echo '</pre>';
        }
        pre($unserialize);
}

» 版权所有:YaoLei's Blog » 简单的PHP序列化数组例子
» 本文链接:http://www.yaolei.info/archives/166