用來處理和轉換 Emoji 表情的PHP庫:php-emoji
php-emoji 是個 PHP 庫用來處理和轉換 Emoji 表情的。
使用方法:
<?php
include('emoji.php');
# when you recieve text from a mobile device, convert it
# to the unified format.
$data = emoji_docomo_to_unified($data); # DoCoMo devices
$data = emoji_kddi_to_unified($data); # KDDI & Au devices
$data = emoji_softbank_to_unified($data); # Softbank & pre-iOS6 Apple devices
$data = emoji_google_to_unified($data); # Google Android devices
# when sending data back to mobile devices, you can
# convert back to their native format.
$data = emoji_unified_docomo($data); # DoCoMo devices
$data = emoji_unified_kddi($data); # KDDI & Au devices
$data = emoji_unified_softbank($data); # Softbank & pre-iOS6 Apple devices
$data = emoji_unified_google($data); # Google Android devices
# when displaying data to anyone else, you can use HTML
# to format the emoji.
$data = emoji_unified_to_html($data);
# if you want to use an editor(i.e:wysiwyg) to create the content,
# you can use html_to_unified to store the unified value.
$data = emoji_html_to_unified(emoji_unified_to_html($data));
?>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!