使用 php 嵌入 php emoji 库以接受来自移动设备的输入和显示
我知道这个问题之前被问过,但是另一个线程对我没有太大帮助。
我有我在网上找到的 Emoji php 库的代码。该演示工作正常,但我在将其嵌入到我的网站时遇到问题。
关于如何将此库嵌入到我的网站中以便它接受来自移动设备(如 iPhone)的输入和显示,有什么想法吗?
该演示已设置为仅显示一组图标。
<?
foreach (array(0x2600, 0x1F493, 0x1F502) as $unified){
$bytes = "Hello ".emoji_utf8_bytes($unified)." World";
echo "<tr>\n";
echo "<td>".sprintf('U+%04X', $unified)."</td>\n";
echo "<td>".HtmlSpecialChars(emoji_get_name($unified))."</td>\n";
echo "<td>$bytes</td>\n";
echo "<td>".emoji_unified_to_html($bytes)."</td>\n";
echo "</tr>\n";
}
?>
我希望我的网站在从 iPhone 等移动设备输入时显示表情符号。 我怎样才能做到这一点?
i understand this question was asked before however the other thread was not of much help to me.
i have the code from Emoji php library that i found on line. the demo works just fine however im having trouble embedding it to my site.
any thoughts on how to embed this library with my site so it will accept input and display from a mobile device such as an iphone?
The demo is set up so it only displays a set set of icons.
<?
foreach (array(0x2600, 0x1F493, 0x1F502) as $unified){
$bytes = "Hello ".emoji_utf8_bytes($unified)." World";
echo "<tr>\n";
echo "<td>".sprintf('U+%04X', $unified)."</td>\n";
echo "<td>".HtmlSpecialChars(emoji_get_name($unified))."</td>\n";
echo "<td>$bytes</td>\n";
echo "<td>".emoji_unified_to_html($bytes)."</td>\n";
echo "</tr>\n";
}
?>
i would like my site to display emoji when input from a mobile device such as an iphone.
how can i achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用此库: http://code.iamcal.com/php/emoji/
具体来说,使用
emoji_unified_to_html(emoji_softbank_to_unified($data))
将 iPhone 表情符号转换为 HTML。Use this library: http://code.iamcal.com/php/emoji/
Specifically, use
emoji_unified_to_html(emoji_softbank_to_unified($data))
to convert iPhone emoji into HTML.