473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

serialize / unserialize

I have seen on a couple posts recently, about "serializing" and
"unserializing" objects. What exactly does this mean?

--
Chris Mosser
Jul 16 '05 #1
3 4971
Hi Chris,

you can transform an variable that contains anything (also an objects) into
a string e.g. for saving it in a database. You do that with the function
serialize (http://de3.php.net/manual/de/function.serialize.php) und undo it
(for restoring the vars) with unserialize. I'm not sure if there are
restrictions for objects so that they are not fully "serializable" but
you'll get more information on the net or probably in the next posts,

Just Another Chris
Jul 16 '05 #2
thanks..at least I know where to start

--
Chris Mosser
"christopher vogt" <ch**************@rwth-aachen.de> wrote in message
news:bj**********@nets3.rz.RWTH-Aachen.DE...
Hi Chris,

you can transform an variable that contains anything (also an objects) into a string e.g. for saving it in a database. You do that with the function
serialize (http://de3.php.net/manual/de/function.serialize.php) und undo it (for restoring the vars) with unserialize. I'm not sure if there are
restrictions for objects so that they are not fully "serializable" but
you'll get more information on the net or probably in the next posts,

Just Another Chris

Jul 16 '05 #3
"Chris Mosser" <cm*****@comcast.net> wrote in message news:<q-********************@comcast.com>...
I have seen on a couple posts recently, about "serializing" and
"unserializing" objects. What exactly does this mean?


A typical usage of this allows you to 'serialize' the variables in an
object into the $_SESSION array so that you can later reconstruct the
object with all its variables by using 'unserialize'.

Tony Marston
http://www.tonymarston.net/
Jul 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Sleeman | last post by:
Hi all, i just spent an hour rifling through code to find the cause of a problem only to find it's an oddity with serialization and recursive objects, so figured I'd post for the next person who...
8
by: John Smith | last post by:
Hi, I am using a custom Session Handler. session_set_save_handler is working well. But i want to read the data direct from the database. My problem: php don't uses the standard serialize...
2
by: Andrew | last post by:
Some have suggested that using serialize() and unserialize is faster than reading/writing an array to disk as a simple text file using $array = file('numbers.txt'); Can anyone justify this? ...
7
by: richbl | last post by:
Hello all, I have a question about unserializing a single array element from a serialized array. Can this be done, or must I first unserialize the array, and then access the element? For...
6
by: sandy | last post by:
With java servlets I can declare complex object-oriented class structures as session variables in a servlet. That means I can have a complex HTML form that submits iteratively back to the server...
2
by: onefastmustang | last post by:
I have a cookie that I serialize and set as follows.. $searchdata = $state; $searchdata = $country; $searchdata = $radius; $searchdata = $radius_zip; if ($_GET){ foreach ($_GET as $value){...
1
by: Mark | last post by:
I'd like to take an instance of a class, and serialize it to a file on my computer. No security required on the file. Then, I'd like to be able to unserialize the file later and use the instance...
2
by: Derek Martin | last post by:
Hey list, I have an arraylist containing some objects that I want to serialize and send over the internet and then deserialize back into the arraylist of objects. What I have so far: Dim...
7
by: powellgg | last post by:
I've just taken over a PHP website and am converting it to ASP.NET (don't shoot!). I'm not a PHP guy so I'm doing a lot of searching for things that I aren't obvious, and I'm hoping I'll be able...
1
by: VooDoo | last post by:
Hi, I am using the serialize and unserialize to put and get data from mysql database. I think i could optimise the way i handle the data, but not really sure how. What is the best way to happend...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.