如何在 PHP 代码中插入表情符号?
我有一个用 PHP 语言编写的 Shoutout Box。它没有 Smileys 支持。如何在其中插入笑脸支持?
I have a Shoutout Box written in PHP language.It doesnt have Smileys Support. How Can I Insert Smiley Support in it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
一些当时对我有用的 PHP
;)
Some PHP that worked for me back in the day
;)
您可以简单地执行以下操作:
You can simply do:
我发现了这个,它对我有帮助..
http://os.alfajango.com/css-emoticons/
I found this and it helped me..
http://os.alfajango.com/css-emoticons/
我会使用 javascript 来检查添加的喊声是否有“:-)”之类的组合,并将其替换为笑脸图像
I would use javascript to check added shouts for combinations like ':-)' and replace them with an image of an smiley
使用传递字符串创建函数。并替换为图像中的一些文本,如下所示。
}
Create function with pass string. And replace with the some text to image like below.
}
最好使用笑脸代码,无需使用替换功能。
https://www.w3schools.com/charsets/ref_emoji_smileys.asp
例如:< code>
我将显示 😀
结果:
我将显示
Better to use smiley codes, no need to use replace functions.
https://www.w3schools.com/charsets/ref_emoji_smileys.asp
eg:
<p>I will display 😀</p>
result:
I will display ????