douhao2548 2011-03-18 15:51
浏览 96
已采纳

PHP变量处理函数,serialize()

First off I've read the PHP manual, I've tested it out. Second I still don't understand what it really does? Why would I want to serialize a variable?

  • 写回答

6条回答 默认 最新

  • donglu1973 2011-03-18 15:58
    关注

    You probably wouldn't want to serialise a variable as such, but it is useful to serialise objects and other complex data structures.

    Instead of creating a database table with loads of columns, create a table with a primary key and a blob and serialise a class or array into it. That way you have an infinitly flexible system where if you need to add new data to the database table you don't have to add more columns.

    This is one silly example, but persisting objects into a database is seriously useful if you think about it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据