I'm trying to write to a file in PHP to cache the output of a small portion of code.
ob_start();
echo "Hello";
$fp = fopen("cache/ttcache.php", 'w');
fwrite($fp, ob_get_contents());
fclose($fp);
ob_end_flush();
The file exists and is blank. The fwrite function points to the correct location. It just doesn't write.
Any help?
// my code that creates an outputis filled in.