note 88212 added to function.ob-start

From: Date: Thu, 15 Jan 2009 16:54:57 +0000
Subject: note 88212 added to function.ob-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-149285@lists.php.net to get a copy of this message
Simple cache system for HTML: <?php $cacheFile = 'cache.html'; if ( (file_exists($cacheFile)) && ((fileatime($cacheFile) + 600) > time()) ) { $content = file_get_contents($cacheFile); echo $content; } else { ob_start(); // write content echo '<h1>Hello world to cache</h1>'; $content = ob_get_contents(); ob_end_clean(); file_put_contents($cacheFile,$content); echo $content; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 89.103.2.4 ---- Manual Page -- http://www.php.net/manual/en/function.ob-start.php Edit -- https://master.php.net/note/edit/88212 Del: integrated -- https://master.php.net/note/delete/88212/integrated Del: useless -- https://master.php.net/note/delete/88212/useless Del: bad code -- https://master.php.net/note/delete/88212/bad+code Del: spam -- https://master.php.net/note/delete/88212/spam Del: non-english -- https://master.php.net/note/delete/88212/non-english Del: in docs -- https://master.php.net/note/delete/88212/in+docs Del: other reasons-- https://master.php.net/note/delete/88212 Reject -- https://master.php.net/note/reject/88212 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#149285) next »