在PHP中将utf8mb4字符转换为utf8 [英] convert utf8mb4 characters to utf8 in php
本文介绍了在PHP中将utf8mb4字符转换为utf8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法可以将utf8mb4字符转换为utf8,以存储在utf8 mysql数据库中?然后,当我们从数据库中获取它时,将其还原到utf8mb4.
is there a way to convert utf8mb4 characters to utf8 to store in a utf8 mysql database? and then when we get it from database, restore it to utf8mb4.
目标将电话笑脸存储在utf8数据库中,而无需更改数据库编码.
goal is storing phone smiley in a utf8 database without having to change database encoding.
例如将那些字符的第一个字节替换为一个特殊的字节,然后在恢复时将其改回来?
for example replace first byte of those characters to a special byte and then in restoration change it back?
推荐答案
好吧,我为该列使用BLOB类型.
ok what I did was using BLOB type for that column..
这篇关于在PHP中将utf8mb4字符转换为utf8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文