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 magic code ?

4 Answers   eVenturers, iFlash, Zynga,


Is php good for career?

0 Answers  


how to get the value in script values

1 Answers  


How does integrate SSL certificate in websites and also how to generate CSR in Local machines? plese give some ideas ASAP.....

0 Answers  


Dear Sir, i am a frasher and now i got a job offer from AentteQ Software Technologies for PHP developer.. so i am in confusion that is PHP correct for my carrer or i shud choose other then php for my carrer...plz suggest me

4 Answers   NIIT,






Is it worth learning php in 2019?

0 Answers  


How many ways are there for passing variables between pages in PHP and what are they ?

10 Answers  


What is input sanitization in php?

0 Answers  


How to specify argument default values?

0 Answers  


What does a special set of tags do in php?

0 Answers  


How can we get the properties (size, type, width, height) of an image using PHP image functions?

4 Answers   ConSim,


What are the limitations or drawbacks of PHP ?

4 Answers   iDream,


Categories