I want to read/write word documents using PHP,
I know there is a function in php to work with COM objects which we can use to read and write word documents, but COM
OpenTBS can read and modify DOCX (and other OpenXML files) documents in PHP using the technique of templates.
No temporary files needed, no command lines, all in PHP.
It can add or delete pictures. The created document can be produced as an HTML download, a file saved on the server, or as binary content in PHP.
It can also merge OpenDocument files (ODT, ODS, ODF, ...)
http://www.tinybutstrong.com/opentbs.php