',''','"','"')..." is enough."/> ',''','"','"')..." is enough.">
Home >CMS Tutorial >Empire CMS >How to solve the problem of garbled characters in the automatic interception introduction of Imperial CMS
How to solve the problem of garbled characters when the Empire CMS automatically intercepts the introduction?
Solution to the problem of garbled characters when the introduction is automatically intercepted by Imperial CMS
Many Imperial CMS users will encounter garbled characters when calling the introduction or intercepting the content. Or encounter other unwanted characters. The solution to this problem is given here. Friends who encounter similar problems can refer to it.
Recommended to study "Empire cms tutorial"
First open the file e/class/connect.php and find the function sub($string,$start=0,$length ,$mode=false,$dot='')
Replace the code:
The code is as follows:
$string = str_replace(array(' ','&','"','<','>','''), array(' ','&','"','<','>',"'"), $string);
Replace it with:
The code is as follows :
$string = str_replace(array(' ','&','"','<','>',''','“','”'), array(' ','&','"','<','>',"'",'“','”'), $string);
Analysis: The default interception and replacement function of the empire does not work on double quotes. Adding it here solves this problem. Therefore, if you encounter other similar situations, add the characters to be replaced and the replaced characters here. 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 automatic interception introduction of Imperial CMS. For more information, please follow other related articles on the PHP Chinese website!