Extract text from doc and docx

后端 未结 9 1329
死守一世寂寞
死守一世寂寞 2020-11-27 16:24

I would like to know how can I read the contents of a doc or docx. I\'m using a Linux VPS and PHP, but if there is a simpler solution using other language, please let me kno

9条回答
  •  星月不相逢
    2020-11-27 17:03

    I used docxtotxt to extract docx file content. My code is as follows:

    if($extention == "docx")
    {   
        $docxFilePath = "/var/www/vhosts/abc.com/httpdocs/writers/filename.docx";
        $content = shell_exec('/var/www/vhosts/abc.com/httpdocs/docx2txt/docx2txt.pl     
        '.escapeshellarg($docxFilePath) . ' -');
    }
    

提交回复
热议问题