众所周知,word其实是一个压缩包,我们使用压缩软件打开压缩包,如果有 comments.xml,说明就有批注,只需要读取这个文件就好了。
举例:
$TbsZip = new TbsZip();
$TbsZip->open($file_path);
if (true === $getContent) {
$comment = $TbsZip->FileRead("word/comments.xml");
} else {
$comment = $TbsZip->FileExists("word/comments.xml");
}
@unlink($file_path);
return $comment;