PHP » GoLang |
login |
register |
about
|
mysql_escape_stringmysql_escape_stringfunc MysqlRealEscapeString(value string) string { var sb strings.Builder for i := 0; i < len(value); i++ { c := value[i] switch c { case '\\', 0, '\n', '\r', '\'', '"': sb.WriteByte('\\') sb.WriteByte(c) case '\032': sb.WriteByte('\\') sb.WriteByte('Z') default: sb.WriteByte(c) } } return sb.String() } |