html mysql special character
function html_encode(str)
{
var s = "";
if (str.length == 0) return "";
s = str.replace(/&/g, "&");
s = s.replace(/</g, "<");
s = s.replace(/>/g, ">");
//s = s.replace(/ /g, " ");
s = s.replace(/\'/g, "'");
s = s.replace(/\"/g, """);
//s = s.replace(/\n/g, "<br>");
return s;
} function html_decode(str)
{
var s = "";
if (str.length == 0) return "";
s = str.replace(/&/g, "&");
s = s.replace(/</g, "<");
s = s.replace(/>/g, ">");
s = s.replace(/ /g, " ");
s = s.replace(/'/g, "\'");
s = s.replace(/"/g, "\"");
s = s.replace(/<br>/g, "\n");
return s;
}
html mysql special character的更多相关文章
- 3个问题:MySQL 中 character set 与 collation 的理解;utf8_general_ci 与 utf8_unicode_ci 区别;uft8mb4 默认collation:utf8mb4_0900_ai_ci 的含义
MySQL 中 character set 与 collation 的理解 出处:https://www.cnblogs.com/EasonJim/p/8128196.html 推荐: 编码使用 uf ...
- mysql 中 character set 与 collation 的理解
character set 和 collation 的是什么? character set, 即字符集. 我们常看到的 utf-8, GB2312, GB18030 都是相互独立的 character ...
- MySQL: Connection Character Sets and Collations
character_set_server collation_servercharacter_set_databasecollation_database character_set_clientch ...
- MySQL中character set与collation的理解(转)
character set和collation的是什么? character set即字符集 我们常看到的UTF-8.GB2312.GB18030都是相互独立的character set.即对Unic ...
- 学习笔记:The Best of MySQL Forum
http://mysql.rjweb.org/bestof.html I have tagged many of the better forum threads. 'Better' is based ...
- MySQL之mysql命令使用详解
MySQL Name mysql - the MySQL command-line tool Synopsis mysql [options] db_name Description mysql is ...
- 利用login-path对MySQL安全加固
Preface Connection security is one of the most important safety strategies which we should ...
- linux应用之mysql数据库指定版本的yum安装(centos)
A Quick Guide to Using the MySQL Yum Repository Abstract The MySQL Yum repository provides RPM packa ...
- mysql 修改 root 密码
5.76中加了一些passwd的策略 MySQL's validate_password plugin is installed by default. This will require that ...
随机推荐
- 怎样安装pip--python的包管理工具
pip是python的包管理工具,使用它来安装python的模块很方便. pip支持的操作系统:Unix/Linux, OS X, and Windows. 支持的python版本号:2.6, 2.7 ...
- mongodb 2.6.6 在window10下的安装
首先感谢波仔的知道,其次感叹下WIN10的牛叉,兼容性还不错. 首先,下载mongodb 2.6.6 安装包,可惜,官网太慢,还得注册.不过还好,我是个好人:http://pan.baidu.com/ ...
- 查询SQL中某表里有多少列包含某字段
select c.name from SYSCOLUMNS as c left join SYSOBJECTS as t on c.id=t.id where c.name like '这里是某个字段 ...
- 接收Dialog的值
System.Windows.Forms.DialogResult result = MessageBoxEx.Show("保存成功", Language.String.Hint, ...
- Python核心编程读笔 4
第五章 数字 二.整形 1 布尔型 2 标准整数类型 3 长整型 数字后面加L,能表示非常非常大的数字 目前,整形和长整型逐渐统一!!! 三.双精度浮点数 四.复数 有关复数的几个概念: 表示虚数的语 ...
- puts fputs printf的区别
puts()显示字符串时自动在其后添加一个换行符,函数里的参数是一个地址,从该地址向后面输出,直到遇到空字符,所以要确保输出的字符串里要有空字符.与gets()函数一起使用. fputs()需要第二个 ...
- PHP 定时器 边输出边刷新网页
使用定时器的时候当然想网页能够看到输出,不希望网页直接卡住,定时器结束输出一片. 要做到定时器不卡住输出,只需要两个函数就行了,看下面代码 <?php //定时器测试代码 demo //跟踪定时 ...
- nginx 几个参数
worker_processes : When set to 'auto', which is also the default behavior, Tengine will create the s ...
- tomcat异常
java.lang.UnsupportedClassVersionError: org/apache/lucene/store/Directory : Unsupported major.minor ...
- Invalid signature file digest for Manifest main attributes
Solving a Spark error: Invalid signature file digest for Manifest main attributes When using spark-s ...