encode_forscript(string)

参数:

string, 需要进行格式化的字符串

作用:

当有些字符需要输出并成为JS中的值的时候可使用次函数替换掉其中的['], ["]等关键的字符。