php - 如何显示来自iOS编码的表情符号到php中?

标签 php ios iphone emoji

我们正在开发ios应用程序,并且一步步陷入困境。

在应用程序屏幕中,表情符号是使用ios函数NSNonLossyASCIIStringEncoding将api中的api保存在php中的,因此在php中

Sportlich drauf \ud83d\udcaa\ud83c\udffc, bin ein gro\337er Barca fan \ud83d\udc99\u2764\ud83d\udc9b. Besch\344ftige mich viel mit Kunst, Architektur und Geschichtlicher Kunst in meinem schul Verlauf 
\ud83d\ude04. H\366r sehr gerne deutsch Rapp \ud83c\udfbc\ud83c\udfbb, lese gerne Mangans und bin absoluter anime fan \ud83d\udc4c\ud83c\udffc. Rauche und trinke kaum, ich paffe gerne eine Zigarre in sch\366nen Moment und trink nur auf events \ud83d\ude09. 

因此如何将转换后的表情符号在网页中解码并显示为实际的表情符号

我们使用php作为服务器端,使用mysql作为数据库。
可以任何PHP库或其他任何东西将帮助然后让我知道。

我只想在php中解码该字符串并在网页中显示表情符号。

最佳答案

$myInput = '\\ud83d\\ude01';

$myHexString = str_replace('\\u', '', $myInput);
$myBinString = hex2bin($myHexString);

print iconv("UTF-16BE", "UTF-8", $myBinString);

快乐编码

关于php - 如何显示来自iOS编码的表情符号到php中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41184247/

相关文章:

iphone - 将 TextView 添加到 UIAlertView

iphone - 在 objective-c 中释放对象时

php - 与xpath混淆

php - 获取 youtube 订阅者列表给我 400 错误

ios - 重新启动后尝试从 Documents 目录读取保存的数据时失败

ios - 一旦计时器归零,如何使丢失标 checkout 现?

ios - 将应用商店中的应用设备目标仅限于 iPhone?

php - "Get"函数不起作用,因为不是所有的连字符都应该被替换

php php_replace 正则表达式\\\正斜杠

javascript - 检测过度滚动的结束