 |
การดึงข้อมูลจากไฟล์ word มาโชว์ในหน้า php ทำได้ไหมค่ะ |
|
 |
|
|
 |
 |
|
เปิด php_zip.dll แล้ว แต่ยังขึ้น Fatal error: Class 'ZipArchive' not found อะคะ ทำไงดี
|
 |
 |
 |
 |
Date :
2012-11-21 16:18:25 |
By :
cikkarat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Restart Apache แล้วใช่ไหม๊ครับ
|
 |
 |
 |
 |
Date :
2012-11-21 16:25:32 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่าได้ละค่ะ ขอบคุนมากค้าา
|
 |
 |
 |
 |
Date :
2012-11-22 10:45:21 |
By :
cikkarat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แต่ตัวที่เป็น Word Reader ไม่แน่ใจว่ามันมีหรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2012-11-22 11:04:43 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พยายามหาอยู่ค่ะแต่ก้องง
เจอ code ตัวนี้ อ่านข้อมูลออกมาแต่เปนภาษาต่างดาว
Code (PHP)
<?php
/*****************************************************************
This approach uses detection of NUL (chr(00)) and end line (chr(13))
to decide where the text is:
- divide the file contents up by chr(13)
- reject any slices containing a NUL
- stitch the rest together again
- clean up with a regular expression
*****************************************************************/
function parseWord($userDoc)
{
$fileHandle = fopen($userDoc, "r");
$line = @fread($fileHandle,filesize($userDoc));
$lines = explode(chr(0x0D),$line);
$outtext = "";
$pos = strrpos($lines[1], chr(0x00));
$outtext.=substr($lines[1],$pos)."";
foreach($lines as $thisline)
{
$pos = strpos($thisline, chr(0x00));
if(($pos !== FALSE) || (strlen($thisline)==0))
{
} else {
$outtext.=$thisline."";
}
}
return $outtext;
}
$userDoc = "CreateWord2.doc";
$text = parseWord($userDoc);
echo $text;
?>
|
 |
 |
 |
 |
Date :
2012-11-23 14:15:45 |
By :
cikkarat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองดู iconv() ครับ แต่ตัวนี้รู้สึกจะเป็นการอ่านแบบ Text หรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2012-11-23 15:02:42 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|