PHP-从上载的Microsoft word文档中获取字数
我试图从上传的word文档中获取字数PHP-从上载的Microsoft word文档中获取字数,php,upload,ms-word,.doc,Php,Upload,Ms Word,.doc,我试图从上传的word文档中获取字数(.doc、.docx、.rtf),但它总是带有令人讨厌的字数格式 有人以前解决过这个问题,知道如何解决吗? 谢谢:)您需要: 区分文件类型 $file_name = $_FILES['image']['name']; $file_extn = end(explode(".", strtolower($_FILES['image']['name']))); if($file_extn == "doc" || $file_extn == "docx"){
(.doc、.docx、.rtf)
,但它总是带有令人讨厌的字数格式
有人以前解决过这个问题,知道如何解决吗?
谢谢:)您需要:
$file_name = $_FILES['image']['name'];
$file_extn = end(explode(".", strtolower($_FILES['image']['name'])));
if($file_extn == "doc" || $file_extn == "docx"){
docx2text();
}elseif($file_extn == "rtf"){
rtf2text();
}
可能重复:感谢您的回复:)这对.docx非常有效,但不幸的是对.rtf无效。难道你不能帮我吗?:)我已经编辑了答案。如果我已经回答了你的问题,请把我的作为问题的答案。