当前位置:网站首页>PHP code wechat, official account and enterprise wechat send emoticons [u+1f449]
PHP code wechat, official account and enterprise wechat send emoticons [u+1f449]
2022-06-28 04:48:00 【fuchto】
Add calling method
function utf8_bytes($cp) {
if ($cp > 0x10000){
return chr(0xF0 | (($cp & 0x1C0000) >> 18)).
chr(0x80 | (($cp & 0x3F000) >> 12)).
chr(0x80 | (($cp & 0xFC0) >> 6)).
chr(0x80 | ($cp & 0x3F));
}else if ($cp > 0x800){
return chr(0xE0 | (($cp & 0xF000) >> 12)).
chr(0x80 | (($cp & 0xFC0) >> 6)).
chr(0x80 | ($cp & 0x3F));
}else if ($cp > 0x80){
return chr(0xC0 | (($cp & 0x7C0) >> 6)).
chr(0x80 | ($cp & 0x3F));
}else{
return chr($cp);
}
}
Convert expression
$content['conten'] Content sent for
$content['content'] = htmlspecialchars_decode($content['content']);
preg_match_all('/\[U\+(\\w{4,})\]/i', $content['content'], $matchArray);
if(!empty($matchArray[1])) {
foreach ($matchArray[1] as $emojiUSB) {
$content['content'] = str_ireplace("[U+{$emojiUSB}]", utf8_bytes(hexdec($emojiUSB)), $content['content']);
}
}边栏推荐
- One article explains in detail | those things about growth
- leetcode:714. The best time to buy and sell stocks includes handling fee [DP dual status]
- A bit of knowledge - online resources on Chinese Learning
- Database garbled
- [csp-j2020] excellent splitting
- Multithreading and high concurrency III: AQS underlying source code analysis and implementation classes
- xml  File read / write
- 27 years, Microsoft IE is over!
- [applet] solution document using font awesome Font Icon (picture and text)
- Severe tire damage: the first rock band in the world to broadcast live on the Internet
猜你喜欢

抖音實戰~關注博主

Code understanding: implementing volume models for hangwriten text recognition

100+数据科学面试问题和答案总结 - 机器学习和深度学习

华为9年经验的软件测试总监工作感悟—写给还在迷茫的朋友
![[NOIP2002 普及组] 过河卒](/img/6c/31fa210e08c7fd07691a1c5320154e.png)
[NOIP2002 普及组] 过河卒

玩转双指针
![[noip2002 popularization group] cross the river pawn](/img/6c/31fa210e08c7fd07691a1c5320154e.png)
[noip2002 popularization group] cross the river pawn

Where does the storm go? Whose pot is the weather forecast wrong?

MySQL gets the current date of the year

100+ data science interview questions and answers Summary - machine learning and deep learning
随机推荐
恭喜我自己,公众号粉丝破万
抖音實戰~關注博主
Pager when importing text files from MySQL
AspNetCoreRateLimit 速率限制 接口访问限制 限流控制
[csp-j2020] excellent splitting
Multithreading and high concurrency III: AQS underlying source code analysis and implementation classes
first. Net core MVC project
Multithreading and high concurrency II: detailed introduction to volatile and CAS
多线程实现 重写run(),怎么注入使用mapper文件操作数据库
Audio and video technology development weekly
Meta universe standard forum established
Google Earth Engine(GEE)——全球洪水数据库 v1 (2000-2018年)
Idle interrupt cannot be cleared
What to do when MySQL changes the password and reports an error
阿里P8倾情推荐,Fiddler抓包工具实战篇(一)
CUPTI error: CUPTI could not be loaded or symbol could not be found.
Short video platform development, click links and pictures to automatically jump to a new page
Password encryption MD5 and salt treatment
JVM I: introduction to JVM and understanding of class files
A doctor's 22 years in Huawei (full of dry goods)