Search code examples
phpcodeigniterserialization

What does it mean to serialize data or an object?


using php, if possible.

What does it mean? I was reading one of my old questions ( How do you pass values between PHP pages for MVC?) and in one of the answers it says:

The part responsible for transferring the data between the controller and the view is the View engine (or class) internal to CodeIgniter. It takes that array from the controller and deserializes it for the view.

I don't know what that means (I read the comments). I put CodeIgniter as the example and tag, but I guess it could be a general question.

Thanks.


Solution

  • To serialize data is to generate a storable representation of a value as a string, for example: json_encode is a type of serialization but PHP has native support also of serialize that can serialize almost any type of data except resources types, you can find a small guide to serialization here: http://www.devshed.com/c/a/PHP/The-Basics-of-Serializing-Objects-in-PHP/

    For the full manual that corresponds to PHP you can find it in the link that Cédric Belin posted in the post below :D