php存储处理Emoji表情问题,在线等待 比如,在线等,请大神赐教: 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 dingyixia zaidingyixia 不知道你要做什么mysql 存储 emoji 表情符,需选用 utf8mb4 字符集 那请问在微网站里显示emoji 表情符该怎么做编码处理呢?mysql> status;--------------mysql Ver 14.14 Distrib 5.6.31, for Linux (x86_64) using EditLine wrapperConnection id: 27640Current database: zuwoCurrent user: root@localhostSSL: Not in useCurrent pager: stdoutUsing outfile: ''Using delimiter: ;Server version: 5.6.31 MySQL Community Server (GPL)Protocol version: 10Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: latin1Client characterset: utf8Conn. characterset: utf8UNIX socket: /var/lib/mysql/mysql.sockUptime: 29 days 9 hours 25 min 11 secThreads: 1 Questions: 168219 Slow queries: 0 Opens: 99 Flush tables: 1 Open tables: 79 Queries per second avg: 0.066--------------mysql> show create table `cc_baseinfo`;+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| cc_baseinfo | CREATE TABLE `cc_baseinfo` ( `userid` int(11) NOT NULL AUTO_INCREMENT, `openid` char(100) NOT NULL, `nickname` char(50) DEFAULT NULL, `sex` enum('0','1') DEFAULT NULL, `language` char(10) DEFAULT NULL, `city` char(30) DEFAULT NULL, `province` char(30) DEFAULT NULL, `country` char(30) DEFAULT NULL, `headimgurl` char(225) DEFAULT NULL, `privilege` char(30) DEFAULT NULL, `unionid` char(100) DEFAULT NULL, `registertime` datetime DEFAULT NULL, `logintime` datetime DEFAULT NULL, `phone` char(15) DEFAULT NULL, `age` tinyint(3) unsigned DEFAULT NULL, `stature` tinyint(3) unsigned DEFAULT NULL, `profession` char(40) DEFAULT NULL, `weixinhao` char(255) DEFAULT NULL, `picureurl` char(225) DEFAULT NULL, `chuzufanwei` char(225) DEFAULT NULL, `shixin` decimal(10,2) DEFAULT NULL, `rixin` decimal(10,2) DEFAULT NULL, `chengyi` char(255) DEFAULT NULL, `dangqi` char(255) DEFAULT NULL, `tedian` char(255) DEFAULT NULL, `status` enum('0','1','2','3','4','5') DEFAULT '0', `picureurl2` char(255) DEFAULT NULL, `picureurl3` char(255) DEFAULT NULL, `picureurl4` char(255) DEFAULT NULL, `picureurl5` char(255) DEFAULT NULL, `picureurl6` char(255) DEFAULT NULL, `shangjiareason` char(255) DEFAULT NULL, `shimingreason` char(255) DEFAULT NULL, `neverreason` char(255) DEFAULT NULL, `shiming` enum('0','1','2','3') DEFAULT '0', `mecity` char(30) DEFAULT NULL, `mesex` char(100) DEFAULT NULL, `meage` char(100) DEFAULT NULL, `mestature` char(100) DEFAULT NULL, `mepaixu` char(100) DEFAULT NULL, `zhaohu` int(11) DEFAULT NULL, `star` tinyint(3) unsigned DEFAULT NULL, `picureurl7` char(255) DEFAULT NULL, `picureurl8` char(255) DEFAULT NULL, `sfzcode` char(25) DEFAULT NULL, `zsname` char(25) DEFAULT NULL, `dingweicity` char(30) DEFAULT NULL, `dingweiprovince` char(30) DEFAULT NULL, `shimingtime` datetime DEFAULT NULL, PRIMARY KEY (`userid`)) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8mb4 |+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)mysql> 而且现在还有bug,字符集插入数据库就显示4个???? 四个?只是mysql的显示问题,mysql无法显示不能代表数据有问题,只要php读取的是正确的就行了。emoji是二进制编码,一般直接输出到html里是无法显示的最简单的验证方法是用二进制去校验读出来的有没有问题比如这样验证:if ($value === "\uXXXX\uXXXX\uXXXX") 图片的上传问题 读取文件并把数据入库。。内存不够 问一个问题,是不是学历真的不重要。是不是真的有水平就可以。。。 关于二级域名解析的问题, phpMyAdmin 登录问题 如何让一个页面自动跳出框架 招聘程序员 请问能在php里,,建表的吗?oracle.. 能否在页面提交之前,在客户端用JAVASCRIPT对用户输入的EMAIL的格式进行检查? post文件中有一段代码很让我烦恼 json_decode解析json返回NULL 在lnmp环境中,PHP7.0连接PDO扩展,返回could not find driver
mysql> status;
--------------
mysql Ver 14.14 Distrib 5.6.31, for Linux (x86_64) using EditLine wrapperConnection id: 27640
Current database: zuwo
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.31 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 29 days 9 hours 25 min 11 secThreads: 1 Questions: 168219 Slow queries: 0 Opens: 99 Flush tables: 1 Open tables: 79 Queries per second avg: 0.066
--------------mysql> show create table `cc_baseinfo`;
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cc_baseinfo | CREATE TABLE `cc_baseinfo` (
`userid` int(11) NOT NULL AUTO_INCREMENT,
`openid` char(100) NOT NULL,
`nickname` char(50) DEFAULT NULL,
`sex` enum('0','1') DEFAULT NULL,
`language` char(10) DEFAULT NULL,
`city` char(30) DEFAULT NULL,
`province` char(30) DEFAULT NULL,
`country` char(30) DEFAULT NULL,
`headimgurl` char(225) DEFAULT NULL,
`privilege` char(30) DEFAULT NULL,
`unionid` char(100) DEFAULT NULL,
`registertime` datetime DEFAULT NULL,
`logintime` datetime DEFAULT NULL,
`phone` char(15) DEFAULT NULL,
`age` tinyint(3) unsigned DEFAULT NULL,
`stature` tinyint(3) unsigned DEFAULT NULL,
`profession` char(40) DEFAULT NULL,
`weixinhao` char(255) DEFAULT NULL,
`picureurl` char(225) DEFAULT NULL,
`chuzufanwei` char(225) DEFAULT NULL,
`shixin` decimal(10,2) DEFAULT NULL,
`rixin` decimal(10,2) DEFAULT NULL,
`chengyi` char(255) DEFAULT NULL,
`dangqi` char(255) DEFAULT NULL,
`tedian` char(255) DEFAULT NULL,
`status` enum('0','1','2','3','4','5') DEFAULT '0',
`picureurl2` char(255) DEFAULT NULL,
`picureurl3` char(255) DEFAULT NULL,
`picureurl4` char(255) DEFAULT NULL,
`picureurl5` char(255) DEFAULT NULL,
`picureurl6` char(255) DEFAULT NULL,
`shangjiareason` char(255) DEFAULT NULL,
`shimingreason` char(255) DEFAULT NULL,
`neverreason` char(255) DEFAULT NULL,
`shiming` enum('0','1','2','3') DEFAULT '0',
`mecity` char(30) DEFAULT NULL,
`mesex` char(100) DEFAULT NULL,
`meage` char(100) DEFAULT NULL,
`mestature` char(100) DEFAULT NULL,
`mepaixu` char(100) DEFAULT NULL,
`zhaohu` int(11) DEFAULT NULL,
`star` tinyint(3) unsigned DEFAULT NULL,
`picureurl7` char(255) DEFAULT NULL,
`picureurl8` char(255) DEFAULT NULL,
`sfzcode` char(25) DEFAULT NULL,
`zsname` char(25) DEFAULT NULL,
`dingweicity` char(30) DEFAULT NULL,
`dingweiprovince` char(30) DEFAULT NULL,
`shimingtime` datetime DEFAULT NULL,
PRIMARY KEY (`userid`)
) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8mb4 |
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)mysql> 而且现在还有bug,字符集插入数据库就显示4个????
emoji是二进制编码,一般直接输出到html里是无法显示的
最简单的验证方法是用二进制去校验读出来的有没有问题
比如这样验证:
if ($value === "\uXXXX\uXXXX\uXXXX")