monkeypaw201 Posted July 8, 2008 Share Posted July 8, 2008 i am looking for a way to create a html file generated via PHP, i know how to create the file: <?php $ourFileName = "testFile.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fclose($ourFileHandle); ?> but im not sure how to write to it to create the same output as the page.. (html) and save it on that file.. any help? Link to comment https://forums.phpfreaks.com/topic/113814-saving-generated-page/ Share on other sites More sharing options...
discomatt Posted July 8, 2008 Share Posted July 8, 2008 Uhm, you could use object buffering... ( ob_start() ) store the buffer in a string ( ob_get_contents() ) then write the string to the file handle ( fwrite() ) Link to comment https://forums.phpfreaks.com/topic/113814-saving-generated-page/#findComment-584882 Share on other sites More sharing options...
monkeypaw201 Posted July 8, 2008 Author Share Posted July 8, 2008 could you provide a sample code? i've nvr done either of those functions() Link to comment https://forums.phpfreaks.com/topic/113814-saving-generated-page/#findComment-584885 Share on other sites More sharing options...
discomatt Posted July 8, 2008 Share Posted July 8, 2008 Check the manual, there's an ample amount of examples. It's a very straightforward function set. Link to comment https://forums.phpfreaks.com/topic/113814-saving-generated-page/#findComment-584886 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.