php读取word里面的内容antiword

其实是现在一个linux下的扩展

 1 先安装  antiword

yum antiword install

2 写测试php代码

header("Content-type: text/html; charset=utf-8");  
  
$filename = '1.doc';  
$content = shell_exec('antiword -mUTF-8 '.$filename);   
  
echo '<pre>';  
print_r ($content);  
echo '</pre>';  

可以输出 正常 

有个不错的phpword 就是要安装的扩展比较多,有空的可以试试 ,这个更强大

 

原文地址:https://www.cnblogs.com/baker95935/p/7346235.html