* Thus wrote Mag: > Hi, > I have never done this before (but in my first test it > seems to work), I am include()ing a file into a > variable like this: > > $a=include("th-file.php"); > > Will this give me any extra problems later on? or is > this resource intensive? > > The reason I am doing this is because I want to put > whole pages into a variable then write the contents of > the variable to a static html file...
Writing everything to a variable doesn't make much sense to me, I'd write a little wrapper for Output Buffering to use: class SaveToFile { function open($file) { //open file... } function write($buf) { //write to file... } function close() { //close file } } $obSaveFile = new SaveToFile(); $obSaveFile->open('/path/to/file.html'); ob_start(array(&$obSaveFile, 'save'), 1024); /* do your stuff here */ ob_end_flush(); $obSaveFile->close(); Curt -- Quoth the Raven, "Nevermore." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php