I have a 2 dimensional array which is like that;
$results[$i][$j]->title;
$results[$i][$j]->snippet;
$results[$i][$j]->link;
It is full with values. I have to use this variable with its values into a different page.
I try it with session but it gives errors.
How can I solve this problem?
Thanks for your help.
If you attempt to serialize the object within a session (as previously suggested) then remember that the member functions __sleep and __wakeup will automatically be called. Moreover, you will need to ensure that the constructor of the object’s class is available on the subsequent page. (This is a very common wall people run hit when trying to pass objects vis $_SESSION.)
http://php.net/function.serialize
See also:
http://php.net/language.oop5.serialization
Had you considered just extracting the object attributes you need and storing them as scalar values in an array? This would be easily storable via $_SESSION and would not require additional consideration.