I believe there is quite a bit of difference in the encoding of different versions of MS .doc files. If you want to write this with just PHP, you'll have to find available documentation on the .doc formats.
I believe the latest .doc formats use an XML format, so it should be the easiest to go with.
If you want another application to do the work for you, you can invoke that application from the command line. A good application would be openoffice writer, though there may be applications specifically developed for conversions between .doc formats. If you really want to pursue it you can look at the source code for Open Office and see how it does the conversions. http://download.openoffice.org/2.1.0/source.html
To execute a shell command in PHP use the exec(), or system() functions or a similar alternative to those two.
A simpler way to do it is to duplicate the HTML file in Microsoft Word and save the file as a .doc extension. Upload the .doc file to your server. Put a Hyperlink on your HTML file pointing to the .doc file. A user can download it by just clicking the link. It works fine for me here, by just clicking the "Download User Guide" button.
can u please tell me how to convert html page into word document so tat the user can download the page in html format