What is serialization / object serialization ?

Answers were Sorted based on User's Feedback



What is serialization / object serialization ?..

Answer / sloog

Serializing an object means converting it to a bytestream
representation that can be stored in a file. This is useful
for persistent data; for example, PHP sessions automatically
save and restore objects. Serializatioin in PHP is
mostly automatic--it requires little extra work from you,
beyond calling the serialize() and unserialize() functions:

$encoded = serialize(something);
$something - unserialize(encoded);

Is This Answer Correct ?    4 Yes 0 No

What is serialization / object serialization ?..

Answer / ranjan

Say we have some information in the form of object or array
and we want to store that into database then we should
serialize that and then we can store the returned string in
the database. While accessing we will have to unserialize that.

Also if we want to play with the string before we store the
above string into the database then we need to use it
everytime by unserializing it.

We can avoid this if we register this iobject with the
session and then nsession will automatically unserialize it
and we need not to unserialize it before playing or while
storing

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More PHP Interview Questions

What is ci framework in php?

0 Answers  


display selected value in dropdown list through javascript without page refresh

1 Answers  


What is == and === in php?

0 Answers  


Is php required for wordpress?

0 Answers  


In php, objects are they passed by value or by reference?

0 Answers  


What is the use of trim function in php?

0 Answers  


What is a session in php?

0 Answers  


How stop the execution of a php scrip?

0 Answers  


What is cookie and session in php?

0 Answers  


How to get the number of characters in a string?

0 Answers  


how to do connectivity of 2 dbs in PHP script?

3 Answers   TCS,


What is indexing in mysql and how do we create indexing in mysql

4 Answers  


Categories