使用工具把doc转html后,发现html源码中的中文都变成了年这种形式的,上手册查了下解决办法,贴出来,以供以后使用
<?php
header('Content-Type:text/html; Charset=utf-8;');
$input = file_get_contents('14.html');
$output = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $input);
/* Plain UTF-8. */
echo $output;