Look at http://sk.php.net/unserialize Example 1. unserialize_callback_func example
Marco Schuler wrote:
Hi
I have to serialize an object in a session. Generally there is no problem with this if the class-definition file(s) are included _before_ starting the session, as explained in the php-manual:
<quoting>
It is strongly recommended that you include the class definitions of all such registered objects on all of your pages, even if you do not actually use these classes on all of your pages. If you don't and an object is being unserialized without its class definition being present, it will lose its class association and become an object of class stdClass without any functions available at all, that is, it will become quite useless.
</quoting>
I am using PEAR classes for my project. If I want to store such an object in a session, I would have to include all the class-definitions that are included within the class that I am using. There can be a lot of included classes or also dynamically incldued classes.
Has somebody got an idea or an acceptable solution to handle this without including all the class-definitions?
-- Cheers! Marco
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php