Q:

Is it possible to retain a variable in memory (RAM) in PHP?

I'm studying high-performance coding for websites in PHP, and this idea popped into my mind:
We know that accessing a database uses a significant amount of CPU usage, so we cache such data, saving it to the HDD. But I was wondering, can't it rest in the RAM of the server, so I can access it even more faster?

A:

You might want to check out memcached:
http://www.php.net/manual/en/intro.memcache.php

