发表时间:2014-09-05来源:网络
今天项目升级到php5.4,gbk编码,htmlspecialchars转换后的字符串为空,郁闷啊
解决,加上编码吧,这么多地方用到htmlspecialchars,改起来真麻烦,看来以后得自己封装一下了。
UPGRADING说到
[html]
- the default character set for htmlspecialchars() and htmlentities() is
now UTF-8. In previous versions it was ISO-8859-1. Note that changing
your output charset via the php.ini default_charset directive does not
affect htmlspecialchars/htmlentities unless you are passing "" (an
empty string) as the encoding parameter to your htmlspecialchars/htmlentities
calls.
手册中也说到
[html]
string htmlspecialchars ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = 'UTF-8' [, bool $double_encode = true ]]] )
[html]
Defines encoding used in conversion. If omitted, the default value for this argument is ISO-8859-1 in versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards.
上一篇:drupal学习之-目录结构
CI框架连接数据库配置操作以及多数据库操作
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
C语言关键字及其解释介绍 C语言32个关键字详解
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
PHP中的(++i)前缀自增 和 (i++)后缀自增
将视频设置为Android手机开机动画的教程
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
常用dos命令及语法
PHP中include和require区别之我见
甜蜜守护手表版客户端下载v1.3.4 安卓版
62.66MB |生活服务
视力筛查软件(改名智能筛查)下载vv3.5.62 安卓版
57.63MB |生活服务
云高高尔夫官方版下载v9.16 安卓版
74.52MB |生活服务
京东优悠保软件下载v3.9.70 安卓版
53.16MB |生活服务
天猫校园超市下载v4.5.4 安卓版
116.06MB |生活服务
驾考家园2025新版本下载v6.83 安卓版
166.97M |学习教育
e网充手机版下载v1.2.6
40.63MB |生活服务
专利代理师考试聚题库app下载v2.0.7 安卓版
77.19MB |学习教育
2014-09-05
2022-03-20
2022-03-21
2022-03-24
2014-09-05
2014-09-05
2015-07-05
2014-09-05
2022-03-21
2014-09-05