Writing simple caching system in PHP
<p>I'm writing a simple caching system in PHP, but I'm not sure where to begin.</p>

<p>For example, I have code that's like this:</p>

<pre><code>//dont cache
&lt;div&gt; ...... &lt;/div&gt;
//dont cache
&lt;div&gt; ...... &lt;/div&gt;
//cache
&lt;div&gt; &lt;?php bigQuery(); ?&gt; &lt;/div&gt;
//dont cache
&lt;div&gt; ...... &lt;/div&gt;
</code></pre>

<p>At the simplest level, I just want to write the output of the part of the code I wish to cache to a file. I know how to check for the existence of a file, but I'm not sure how to pull a specific part of the page's output in the way I want it, nor how to write to a file with PHP.</p>

<p>Any help?</p>
