现在做一个网站项目: 要求实现 php读取word内容后  输出到html下面是代码
/*  
读取WORD档内容,并且以HTML展示
*/
$tempfile=dirname(__FILE__)."/".$_GET['id'].".doc";
@unlink($tempfile);
file_put_contents($tempfile,$st);
$word = new COM("word.application") or die ("Could not initialise MS Word object.");
$word->Documents->Open(realpath($tempfile));
$content = (string) $word->ActiveDocument->Content;
echo '<pre style="word-wrap: break-word; word-break: normal; width:800px;"><content>'.$content.'</content></pre>';
$word->ActiveDocument->Close(false); 
$word->Quit(0);
$word = null;
unset($word);
@unlink($tempfile);现在问题是 :   echo '<pre style="word-wrap: break-word; word-break: normal; width:800px;"><content>'.$content.'</content>   输出到html后 格式丢失, 不能保持原来的word内容格式
求助!!!!