Store PHP variables in memory between script executions
There is few options:
Memcache http://memcached.org/ extension. It's RAM based storage engine.
APC APC - PHP manual apc code cache allows store variables.
If you don't want any extensions you could store your data into file (serialize, or xml format), and it will be persistent data. Slower then memory storage.
And if you want to store general data, well then there is "one-hundred-two" database engines. For example MySQL, SQLite or NOSQL MongoDB and more...