How to use php serialize() and unserialize()

后端 未结 10 1873
Happy的楠姐
Happy的楠姐 2020-11-22 05:03

My problem is very basic.

I did not find any example to meet my needs as to what exactly serialize() and unserialize() mean in php? They ju

10条回答
  •  迷失自我
    2020-11-22 05:45

    From http://php.net/manual/en/function.serialize.php :

    Generates a storable representation of a value. This is useful for storing or passing PHP values around without losing their type and structure.

    Essentially, it takes a php array or object and converts it to a string (which you can then transmit or store as you see fit).

    Unserialize is used to convert the string back to an object.

提交回复
热议问题