Monday, November 06, 2006

How to create microsoft word(.doc) file using PHP?

<?php
$filepnt = fopen("hellohtml.doc", 'w+');
$content = "<html><head></head><body><b>Say hello</b> to my http server</body></html>";
fwrite($filepnt, $content);
fclose($filepnt);
echo '<a href="hellohtml.doc">Download as .doc</a>';
?>

No comments: