I am having difficulty finding the best way to cache output of PHP functions.

I basically have a set of PHP functions that I would like to cache the HTML output of.

My plan right now is to cache each output individually, using a caching prog like cache_lite, as 1.cache, 2.cache, etc. I'm caching them separating because I would like the user to have the option of deciding where they want each PHP output displayed.

Then, I will use fopen, fread commands to read the output in the main HTML document. I am worried that this isn't a very optimized way because I would have to issue separate fopen calls for different files. If there are many users, this might hurt performance.

Is there a better way to store HTML output of separate PHP functions? Perhaps in just one array?