PHP code example of biangbiang / emoji
1. Go to this page and download the library: Download biangbiang/emoji library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
biangbiang / emoji example snippets
ji = new Biang\Emoji\Emoji();
$text = 'hello โบ๐๐๐ค๐ถ๐๐๐๐ซ๐ฑ๐ฆ๐ช๐ฒ๐ค๐๐
๐๐๐๐๐๐๐ค๐ ๐๐ฉ๐จ๐ง๐๐ค๐ด๐๐๐๐๐๐๐๐ค๐๐ณ๐ก๐ฃ๐ค๐ฐ๐ข๐ญ๐ท world';
$smile = '๐';
// transform emoji to utf-8
$utf8Text = $emoji->emojiToUtf8($smile);
// remove emoji from text
$removeText = $emoji->removeEmoji($text);
// transform emoji to string with transformDict
$transformDict = array(
"\xF0\x9F\x99\x82" => "[ๅพฎ็ฌ]",
"\xF0\x9F\x98\x84" => "[ๅปๅป]",
"\xF0\x9F\x98\xAC" => "[ๅๅ]",
"\xF0\x9F\x98\x87" => "[ๅฏๆ]",
"\xF0\x9F\x98\x86" => "[ๆ้ผป]" ,
"\xF0\x9F\x98\xA5" => "[ๅๆ]",
"\xF0\x9F\x98\x93" => "[ๅๆ]",
"\xF0\x9F\x99\x84" => "[ๅฎณ็พ]",
"\xF0\x9F\x98\x9C" => "[ๆค็ผ]",
"\xF0\x9F\x98\x9D" => "[ๆค็ผ]",
"\xF0\x9F\x98\x9B" => "[ๆค็ผ]",
"\xF0\x9F\xA4\x90" => "[้ญๅด]",
"\xF0\x9F\x98\xB7" => "[้ญๅด]",
"\xF0\x9F\x98\x90" => "[้่ง]",
"\xF0\x9F\x98\xB5" => "[็ฑไฝ ]",
"\xF0\x9F\x98\xAD" => "[ๆณช]",
"\xF0\x9F\x98\x81" => "[ๅท็ฌ]",
"\xF0\x9F\x98\x9A" => "[ไบฒไบฒ]",
"\xF0\x9F\x98\x99" => "[ไบฒไบฒ]",
"\xF0\x9F\x98\x96" => "[็็
]",
"\xF0\x9F\x98\x8A" => "[ๅคชๅผๅฟ]" ,
"\xF0\x9F\x98\x81" => "[็ฝ็ผ]",
"\xF0\x9F\x98\x97" => "[ๅณๅผๅผ]",
"\xF0\x9F\x98\x9A" => "[ๅทฆๅผๅผ]",
"\xF0\x9F\x98\x91" => "[ๅ]",
"\xF0\x9F\x98\xA2" => "[่กฐ]",
"\xF0\x9F\x98\xB2" => "[ๅงๅฑ]",
"\xF0\x9F\x98\xA4" => "[ๅ]",
"\xF0\x9F\x98\xB4" => "[ๅๆฌ ]",
"\xF0\x9F\x98\x9D" => "[ๆฑๆฑ]",
"\xF0\x9F\x98\xA1" => "[ๆ]",
"\xF0\x9F\xA4\x94" => "[็้ฎ]",
"\xF0\x9F\x98\x8B" => "[้ฆๅด]",
"\xF0\x9F\x98\x94" => "[ๆ่]",
"\xF0\x9F\x98\x85" => "[ๆฑ]",
"\xF0\x9F\x98\xAF" => "[ๅฐ]",
"\xF0\x9F\x98\xAA" => "[็ก]",
"\xF0\x9F\x98\xB0" => "[็ก]",
"\xF0\x9F\xA4\x91" => "[้ฑ]",
"\xF0\x9F\x98\xAE" => "[ๅคฑๆ]",
"\xF0\x9F\x98\x8E" => "[้
ท]",
"\xF0\x9F\x98\x8d" => "[่ฒ]",
"\xF0\x9F\x98\x92" => "[ๅผ]",
"\xF0\x9F\xA4\x97" => "[้ผๆ]",
"\xF0\x9F\x98\xA8" => "[ๆ]",
"\xF0\x9F\x98\x9F" => "[ๆฒไผค]",
"\xF0\x9F\x98\xAB" => "[ๆฒไผค]",
"\xF0\x9F\x98\xA9" => "[ๆฒไผค]",
"\xF0\x9F\x98\x8C" => "[ๆฒไผค]",
"\xF0\x9F\x98\xA0" => "[ๆ็]",
"\xF0\x9F\x98\x95" => "[้ป็บฟ]",
"\xF0\x9F\x98\x8F" => "[้ป็บฟ]",
"\xF0\x9F\x99\x81" => "[้ด้ฉ]",
"\xF0\x9F\x98\xA3" => "[ๆ้ช]",
"\xF0\x9F\x98\xA6" => "[ๅฟ]",
"\xF0\x9F\x98\x9E" => "[ไผคๅฟ]",
"\xF0\x9F\x98\x92" => "[ไผคๅฟ]",
"\xF0\x9F\x98\xB6" => "[็ชๅคด]",
"\xF0\x9F\x98\xA7" => "[็ฅ้ฉฌ]",
"\xF0\x9F\xA4\x93" => "[ๅปๆ
่ก]",
"\xF0\x9F\x98\x89" => "[ๆๅณ]",
"\xF0\x9F\x98\xB3" => "[doge]",
"\xF0\x9F\x98\xB1" => "[ๅตๅต]",
"\xF0\x9F\x98\x82" => "[็ฌcry]",
"\xF0\x9F\xA4\x92" => "[่ๆๅพๆ]",
"\xF0\x9F\x99\x83" => "[ๅ]",
"\xF0\x9F\xA4\x95" => "[ๅไผค]"
);
$transformText = $emoji->transformEmoji($transformDict, $text);