Reading/Writing a MS Word file in PHP

前端 未结 16 1606
借酒劲吻你
借酒劲吻你 2020-11-22 14:35

Is it possible to read and write Word (2003 and 2007) files in PHP without using a COM object? I know that I can:

$file = fopen(\'c:\\file.doc\', \'w+\');
fw         


        
16条回答
  •  渐次进展
    2020-11-22 14:43

    You can use Antiword, it is a free MS Word reader for Linux and most popular OS.

    $document_file = 'c:\file.doc';
    $text_from_doc = shell_exec('/usr/local/bin/antiword '.$document_file);
    

提交回复
热议问题