note 50488 added to function.ob-start
| From: | (Paseur...ImagineDB.com) | Date: | Tue, 01 Mar 2005 21:50:03 +0000 |
| Subject: | note 50488 added to function.ob-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85750@lists.php.net to get a copy of this message | ||
You can use PHP to generate a static HTML page. Useful if you have a complex script that, for
performance reasons, you do not want site visitors to run repeatedly on demand. A "cron"
job can execute the PHP script to create the HTML page. For example:
<?php // CREATE index.html
ob_start();
/* PERFORM COMLEX QUERY, ECHO RESULTS, ETC. */
$page = ob_get_contents();
ob_end_clean();
$cwd = getcwd();
$file = "$cwd" .'/'. "index.html";
@chmod($file,0755);
$fw = fopen($file, "w");
fputs($fw,$page, strlen($page));
fclose($fw);
die();
?>
----
Manual Page -- http://www.php.net/manual/en/function.ob-start.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50488
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50488&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50488&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50488&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50488&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50488&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50488&report=yes
Search -- http://master.php.net/manage/user-notes.php