Q:

how can i save content of current webpage in word through php

i need to save contents of webpage on word. i need to keep the links and formating too. if i send 
$ter=$ter. "<a href='$url'>".$chunk."</a> ";
 $fp  =  fopen("test.doc",  'w+'); 
        $str  =  $ter;

        fwrite($fp,  $str); 

        fclose($fp);

i get  a word document but i loose the links ..it comes out as 
a href='http://www.google.com/search?q=sells+sea+shells%0D%0A'>sells sea shells

A:

Going along with this weird pretend ".doc" file which Word (2007) does seem to display as a document; if I change your fwrite line:
fwrite($fp,  '<html><body>' . $str . '</body></html>');

It works.

