gerkintrigg Posted December 17, 2009 Share Posted December 17, 2009 I wondered if anyone knows how to save the rendered output of a PHP script as a file? I have a script that creates dynamic PDF documents, but want to save it as a file, rather than render it to the browser. could I do something like $file=save_as_file(output('file.php')); ? (I know the code above is wrong) Link to comment https://forums.phpfreaks.com/topic/185451-saving-php-output-as-a-file/ Share on other sites More sharing options...
trq Posted December 17, 2009 Share Posted December 17, 2009 ob_start() include "filetocapture.php"; file_put_contents('filetosave.txt', ob_get_clean()); Link to comment https://forums.phpfreaks.com/topic/185451-saving-php-output-as-a-file/#findComment-979092 Share on other sites More sharing options...
gerkintrigg Posted December 19, 2009 Author Share Posted December 19, 2009 thanks. Link to comment https://forums.phpfreaks.com/topic/185451-saving-php-output-as-a-file/#findComment-980344 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.