我正在尝试读取 Word 文件的内容。我使用了下面的代码,但它发出警告警告:fread() [function.fread]:长度参数必须大于 0
$filename=$file->getFilename();
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if($ext=='docx')
{
$fname = fopen($filename, 'r');
if (is_readable($filename))
{
$content = fread($fname,filesize($filename));
echo $content;
}
else
{
echo 'The file is not readable.';
}
fclose($fname);
}