views:

25

answers:

1

Is it possible to omit certain variables from serialization? Say I have a temporary variable in a php object that I don't want serialized as it is a waste of space. The only thing I can think of is making them static but this is not ideal as it is not really part of the object which there will be many instances of.

This may not even be possible but would love to hear some ideas.

+1  A: 

Take advantage of the __sleep method of your object.

Myles
Perfect! Thanks a lot, mate.
Louis
Glad I could help.
Myles