Home  >  Article  >  CMS Tutorial  >  How to solve discuz3.4 special character garbled characters

How to solve discuz3.4 special character garbled characters

青灯夜游
青灯夜游forward
2021-03-16 10:29:033176browse

下面discuz栏目给大家介绍一下discuz3.4特殊字符乱码的解决方案。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

How to solve discuz3.4 special character garbled characters

相关推荐:《discuz教程

Discuz!3.4升级后,贴子内容使用Unicode编码会出现直接显示源码问题

打开:source\function\function_core.php

$string = str_replace(array('&', '"', '<&#39;, &#39;>'), array('&', '"', '<&#39;, &#39;>'), $string);

下面加入

if(strpos($string, '&#') !== false) {
                $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string);
            }

保存文件 覆盖 更新缓存 刷新贴子看看效果

更多编程相关知识,请访问:编程视频!!

The above is the detailed content of How to solve discuz3.4 special character garbled characters. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete