三叔2016-11-19 14:03:44
php指定编码格式
header("Content-type:application/vnd.ms-word"); header("Content-Disposition: attachment;filename=导出.doc");
如果是文件
$xmlContent = '假设这个字符串里是一段格式良好的XML文本信息、其中包括了特殊字符'; echo mb_detect_encoding($xmlContent, array('utf-8', 'gbk'));//CP936 echo mb_detect_encoding( iconv('gbk', 'utf-8', $xmlContent), array('utf-8', 'gbk'));//UTF-8