PHP file writing problem
<p>I'm trying to write to a file in PHP to cache the output of a small portion of code.</p>

<pre><code>        ob_start();
        echo "Hello";
     $fp = fopen("cache/ttcache.php", 'w');
        fwrite($fp, ob_get_contents());
        fclose($fp);
        ob_end_flush();
</code></pre>

<p>The file exists and is blank. The fwrite function points to the correct location. It just doesn't write.</p>

<p>Any help?</p>
