Home > CMS Tutorial > Empire CMS > body text

How to solve the problem of garbled characters in the automatically intercepted introduction of Imperial CMS

silencement
Release: 2019-11-30 11:24:56
forward
2022 people have browsed it

How to solve the problem of garbled characters in the automatically intercepted introduction of Imperial CMS

Many Imperial CMS users will encounter garbled characters or other unnecessary characters when calling the introduction or intercepting the content. The solution to this problem is given here. Friends who encounter similar problems can refer to it.

First open the file e/class/connect.php and find the function sub($string,$start=0,$length,$mode=false,$dot='')

will The code:

The code is as follows:

$string = str_replace(array(&#39; &#39;,&#39;&&#39;,&#39;"&#39;,&#39;<&#39;,&#39;>&#39;,&#39;&#39;&#39;), array(&#39; &#39;,&#39;&&#39;,&#39;"&#39;,&#39;<&#39;,&#39;>&#39;,"&#39;"), $string);
Copy after login

It is recommended to study "Empirecms Tutorial"

is replaced with:

The code is as follows:

$string = str_replace(array(&#39; &#39;,&#39;&&#39;,&#39;"&#39;,&#39;<&#39;,&#39;>&#39;,&#39;&#39;&#39;,&#39;“&#39;,&#39;”&#39;), array(&#39; &#39;,&#39;&&#39;,&#39;"&#39;,&#39;<&#39;,&#39;>&#39;,"&#39;",&#39;“&#39;,&#39;”&#39;), $string);
Copy after login

Analysis: The empire's default interception and replacement function does not work on double quotes. Adding it here solves this problem, so if you encounter other similar situations, add it here to replace it. characters and the replaced characters.

utf-8 encoding situation:

The code is as follows:

$string = str_replace(array(&#39; &#39;,&#39;&&#39;,&#39;"&#39;,&#39;<&#39;,&#39;>&#39;,&#39;&#39;&#39;,&#39;“&#39;,&#39;”&#39;), array(&#39; &#39;,&#39;&&#39;,&#39;"&#39;,&#39;<&#39;,&#39;>&#39;,"&#39;",&#39;“&#39;,&#39;”&#39;),
Copy after login

The above is the detailed content of How to solve the problem of garbled characters in the automatically intercepted introduction of Imperial CMS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:www.word666.com/cms
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template