tags:

views:

42

answers:

1

How can i serialize objects with fields that contain utf8 strings? Now i get back false after unserialize.

+1  A: 

PHP doesn't care what values strings contain when you use serialize/unserialize. Can you provide a code example to demonstrate this problem

Has the class definition been included at the point when you try to unserialize?

Mark Baker
Then it was a problem when I wanted to save one attribute of an object, that contains htmlsource, but when I not wrote into the __sleep function is worked.but when I wrote into the __sleep function is not worked.I do not know why!
turbod
Please provide code example... you should only need to use the __sleep() method if you're only serializing some attributes of the object, or have additional processing requirements on serialize
Mark Baker
If you only want to serialize one attribute, then why not simply serialize that one attribute rather than the whole object?
Mark Baker