读取word出现乱码????? 你用记事本打开个word文档看看,word不是简单纯文本。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.<?php header("Content-type: application/msword"); readfile("test.doc");?>2.使用com将word文档转换成html,然后显示html,如下:$word = new COM("word.application") or die("Unable to instanciate Word");$word->Visible = 1;$word->Documents->Open("d:/test.doc");$word->Documents[1]->SaveAs("x:/webPath/test_doc.html",8);$word->Quit();$word->Release();$word = null;header('path/test_doc.html'); 怎么显示出word文件后却没有形成hmtl?? 第一种方法本来就是调用客户的word,并嵌套在ie中来打开它,怎么会形成html呢第二种方法是先在服务器上转换成html然后可以用header("location:test_doc.html")转向它或者用header("Content-type: text/html");readfile("webPath/test_doc.html");然后再删除test_doc.html这个文件 用第二种方法是出错:Warning: Invoke() failed: No description available in E:\test\word.php on line 4Warning: Invoke() failed: 发生意外。 in E:\test\word.php on line 5Fatal error: NULL pointer exception in E:\test\word.php on line 5好象是php.ini的设置问题,请问如何设置????急急 不是php.ini设置问题。应该是你服务器office没有安装好。我的这里可以 不会吧!!我的office是已经装好,怎么样才知道装好了??? 结帖:$fp = fopen("aa.doc", "rb"); $read = fread($fp, filesize("aa.doc")); php intval 一个疑惑的错误提示 关于PHP动态修改表单文本框属性的问题 PHPMYADMIN 密码和用户名,都不知道.... 软件的“授权形式”, 用英语怎么说?? 网店集成paypal问题 获取上一页地址栏 我要在主页上显示表hdxmb的所有内容,请问这个段程序有问题吗? 请问引用在 php中作用 ! 用pdo作为接口的数据库连接疑问 php中如何得到某些页面元素的值?急,在线等答!!! 如何读取word文件内容???急急急!!!
<?php
header("Content-type: application/msword");
readfile("test.doc");
?>
2.
使用com将word文档转换成html,然后显示html,如下:
$word = new COM("word.application") or die("Unable to instanciate Word");
$word->Visible = 1;
$word->Documents->Open("d:/test.doc");
$word->Documents[1]->SaveAs("x:/webPath/test_doc.html",8);
$word->Quit();
$word->Release();
$word = null;
header('path/test_doc.html');
然后可以用header("location:test_doc.html")转向它或者用header("Content-type: text/html");
readfile("webPath/test_doc.html");
然后再删除test_doc.html这个文件
好象是php.ini的设置问题,请问如何设置????急急
我的这里可以
$fp = fopen("aa.doc", "rb");
$read = fread($fp, filesize("aa.doc"));