serialize a large array in PHP?

前端 未结 13 2003
死守一世寂寞
死守一世寂寞 2021-01-04 06:11

I am curious, is there a size limit on serialize in PHP. Would it be possible to serialize an array with 5,000 keys and values so it can be stored into a cache?

I am

13条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-04 06:28

    I think better than serialize is json_encode function. It got a drawback, that associative arrays and objects are not distinguished, but string result is smaller and easier to read by human, so also to debug and edit.

提交回复
热议问题