![]() |
what is php serialization
Hi
i came across php serialization but could not figure out what it is?i read php manual but did not get the point. if somebody could throw some light about why and when we need to do serialization and what would happen if we do not do it? thanks |
It's basically the representation of an array as a string. Good for storing the contents of an array in a file, and then being able to rebuild it with ease.
Take the following as a good example. Here we're saving the array, and then reloading it. It will give us the array just how we had it when we created it initially. php Code:
|
Isnt serialization used for converting an object into a string, allowing it to be stored on a database or passed by POST or GET?
At the moment, ive been trying to get a better understanding on when it is actually efficient to use serialization versus using delimiters+explode. I didnt knew you can do that with an array too. I guess its nice for multidimensional ones. I just tested it, I guess it doesnt matter even if youre using what serialize uses as a delimiter on the array values. Darn, thats nice... |
Quote:
|
| All times are GMT. The time now is 09:39 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0