View Full Version : Class memory

05-22-2011, 01:23 AM
Is there a way to make a class variable have memory in side it's object?

For instance I create a new object for the class and assign something to a variable inside that class:

$ob = new mine();
$ob->var = 'me';

Now I want that variable to stay constant in that object in memory when I move to another page on the site me be able to call it and get my text back out. Is this possible, let's call it Object memory?

05-22-2011, 02:54 AM
One option is to serialize the object on the first page into a session variable and then unserialize it on the second page.