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(' ','&','"','<','>','''), array(' ','&','"','<','>',"'"), $string);
It is recommended to study "Empirecms Tutorial"
is replaced with:
The code is as follows:
$string = str_replace(array(' ','&','"','<','>',''','“','”'), array(' ','&','"','<','>',"'",'“','”'), $string);
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(' ','&','"','<','>',''','“','”'), array(' ','&','"','<','>',"'",'“','”'),
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!