开发者

to fetch doc file content

开发者 https://www.devze.com 2023-02-02 00:00 出处:网络
$myFile = \"pdf/document_file.doc\"; $fh = fopen($myFile, \'r\'); $theData = file_get_contents($myFile);
$myFile = "pdf/document_file.doc";
$fh = fopen($myFile, 'r');
$theData = file_get_contents($myFile);
fclose($fh);
echo "<pre>";
echo $theData;
echo "</pre>";

My above script fetches the data from document file but it display some of binary numbers.

I need to display document file content in to html content

For Example If my document file is a resume. i need to fetch the content and di开发者_如何学编程splay document data same as selected file in html page


It IS binary data. To view it as HTML you need to convert it first.

Convert .doc to html in php


You're reading binary data. Hence the "numbers". The raw data needs to go through some "filter/render implementation" first.

Plus, when you use file_get_contents() there's no need to fopen() and fclose().

0

精彩评论

暂无评论...
验证码 换一张
取 消