在php的模版编辑中,因为安全的需要,特殊字符会被过滤掉而无法传递到服务器端,但是我们却离不了这些特殊字符,为了解决这个问题,帝国cms设计了egetzy函数。该函数在/class/connect.php(帝国后台必须引用的文件)中,可见其重要性,其代码为:
//返回转义
function egetzy($n='2'){
    if($n=='rn')
    {
        $str="rn";
    }
    elseif($n=='n')
    {
        $str="n";
    }
    elseif($n=='r')
    {
        $str="r";
    }
    elseif($n=='t')
    {
        $str="t";
    }
    elseif($n=='syh')
    {
        $str=""";
    }
    elseif($n=='dyh')
    {
        $str="'";
    }
    else
    {
        for($i=0;$i<$n;$i++)
        {
            $str.="";
        }
    }
    return $str;
}
应用举例:
- 
	
帝国后台,自定义页面,直接页面式
 
js代码:
who=who.replace(/[^dA-Za-zu3007u4E00-u9FCBuE815-uE864]+/g,',');
这个正则用来替换掉who中的中文,字符,数字以外的其他字符为逗号。表达式中的1个反斜杠需要用四个反斜杠替换能正确生成。
who=who.replace(/[^dA-Za-zu3007u4E00-u9FCBuE815-uE864]+/g,',');
也可以使用egetzy函数完成:
who=who.replace(/[^<?php echo egetzy(2)?>dA-Za-zu3007u4E00-u9FCBuE815-uE864]+/g,',');
2.图片模板中,分割多值字段
 $morepic=$navinfor['morepic'];
    $mpr=explode(egetzy('rn'),$morepic);