How can i collect all the html content of a php page and save it into a doc file and then serve it to user with save prompt.
<?php
ob_start();
echo 'Hello World';
file_put_contents('filename.doc', ob_get_contents());
header('Content-type: application/msword');
// serve filename.doc to user with a save promt.?????
ob_end_flush();
?>
$data = ob_get_contents(); echo $data;.doc, doesn't make it a Word document! This could be interesting: webcheatsheet.com/php/create_word_excel_csv_files_with_php.php