Home PHP Libraries Other libraries emoji expression conversion PHP library
emoji expression conversion PHP library
<?php
include(dirname(__FILE__).'/../lib/emoji.php');
header('Content-type: text/plain; charset=UTF-8');
$GLOBALS['failures'] = 0;
$test_unified= "Hello ".utf8_bytes(0x2649);
$test_iphone= "Hello ".utf8_bytes(0xE240);
$test_docomo= "Hello ".utf8_bytes(0xE647);
$test_kddi= "Hello ".utf8_bytes(0xE490);
$test_google= "Hello ".utf8_bytes(0xFE02C);
$test_html= "Hello ".test_html(2649);
is(emoji_docomo_to_unified($test_docomo),$test_unified, "DoCoMo -> Unified");
is(emoji_kddi_to_unified($test_kddi),$test_unified, "KDDI -> Unified");
is(emoji_softbank_to_unified($test_iphone),$test_unified, "Softbank -> Unified");
is(emoji_google_to_unified($test_google),$test_unified, "Google -> Unified");
echo "#------------------\n

Sometimes we get an expression string and want it to display the corresponding expression, so what should we do in this case? I encountered this need some time ago. When requesting data, the string returned by the background contains expression strings of this type: sad:. If the content is directly displayed on the Label, it will also display: sad:. I searched for a lot of information in this form, and found that it had to be processed by mixing pictures and text. Many of the expression strings were in the form of [crying], and then I was a bit confused about the form: sad: , and later I used regular methods to deal with it, and found that it was really easy to use. It also solved the adaptive height problem of tableviewCell. The emoji expression conversion PHP library perfectly solves this problem

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

Use of PHP regular expression function library Use of PHP regular expression function library

15 Jun 2023

PHP is a widely used development language. Its regular expression function library allows us to easily match, search and replace strings through regular expressions, making our programs more efficient and flexible. In this article, we will introduce the use of the PHP regular expression function library, including commonly used regular expression functions and syntax, to help readers better master the application of regular expressions in PHP. 1. Introduction to regular expression function library In PHP, the function libraries related to regular expressions are mainly PCRE library and POSIX library. That

php emoji expression processing php emoji expression processing

29 Jul 2016

:This article mainly introduces php emoji expression processing. Students who are interested in PHP tutorials can refer to it.

Is there a ready-made Pinyin conversion library for PHP that can be used directly? Is there a ready-made Pinyin conversion library for PHP that can be used directly?

06 Sep 2023

Is there a ready-made Pinyin conversion library for PHP that can be used directly? Pinyin conversion is a common requirement in Chinese processing, especially in scenarios involving Chinese search, sorting, or convenient pinyin input. Many program developers may ask, does PHP have a ready-made Pinyin conversion library that can be used directly? The answer is yes. PHP has many excellent pinyin conversion libraries to choose from. Most of these libraries are based on open source projects, such as pinyin.js and PinyinHelper. In this article, we will introduce two commonly used P

PHP and OpenCV library: How to do facial expression recognition in images? PHP and OpenCV library: How to do facial expression recognition in images?

18 Jul 2023

PHP and OpenCV library: How to do facial expression recognition in images? Introduction: Facial expression recognition is one of the important research directions in the field of computer vision. It can be applied to many practical scenarios, such as human-computer interaction, emotion monitoring, etc. This article will introduce how to use PHP and OpenCV libraries to implement facial expression recognition in images, and attach sample code. 1. Preparation Before starting, we need to prepare some tools and environment. 1. Install the OpenCV library. OpenCV is an open source computer library.

How to process emoji expression packs in APP in php How to process emoji expression packs in APP in php

19 Sep 2017

Usage scenario: PHP serves as the server to receive the interface data of the APP. Due to the format problem of Mysql, there is no way to directly save the emoticon package solution; convert the emoticon into a base64 visible format. Since the length after conversion is too large, replace it with the corresponding character. Save to database

PHP regular expression library implements email address verification PHP regular expression library implements email address verification

06 Jun 2018

This article mainly introduces the PHP regular expression library to implement email address verification. Interested friends can refer to it. I hope it will be helpful to everyone.

See all articles