JSON or serialize

Source: Internet
Author: User
Preferred method to store PHP arrays (Json_encode vs serialize)
Most recommended json_encode, which do we use in practice?

Reply content:

Preferred method to store PHP arrays (Json_encode vs serialize)
Most recommend json_encode , we actually use Which?


  
   

分析了一下时间,json_encode 比serialize 更胜一筹。如果从跨语言角度+数据库说。存JSON的话,其他语言如果有访问数据库的需要,那么json_encode 就是必备了。

通常无论是json_encode还是serialize都不会成为性能瓶颈,所以抛开性能,而考虑可读性、可扩展而言,json_encode最终的胜出:

json_encode serialize
可读性 基本不可读
可扩展 高,其他语言都能解析 只能PHP自己玩
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.