note 9877 added to ob_start

From: Date: Wed, 29 Nov 2000 10:56:56 +0000
Subject: note 9877 added to ob_start
Groups: php.notes 
Request: Send a blank email to php-notes+get-8261@lists.php.net to get a copy of this message
If you want to create static html files from mysql results using templates in order to take some load of the database, you can use something like this to create the files: /* USING OUTPUT BUFFER AND PASSTHRU */ ob_start(); passthru("/usr/local/bin/lynx -source http://www.myserver.com/index.php?id=$id"); $html = ob_get_contents(); ob_end_clean(); // write output to file $fp = fopen("/user/.../html/$id.html", "w"); fwrite($fp, $html); fclose($fp); You could use this in an admin tool for you site, or even in a cron job (though I prefer perl for that). I hope it helps someone. Martin. http://www.php.net/manual/function.ob-start.php

« previous php.notes (#8261) next »