Serializing a string
Store objects or variables:
In your PHP application, project or script you use object or arrays or variables to manage data.
If you need to store the data (for example dumping the whole status of an object with all attributes and all values with one function you can use the
It is very useful if you need to save the state of your complex variables (objects and/or arrays).
serialize() returns a string so you can save it in a database field, or a text file, or a caching system.