emoji的表情转换PHP类库.zip
<?php header('Content-type: text/plain; charset=UTF-8'); $in = file_get_contents('emoji-data/emoji.json'); $catalog = json_decode($in, true); echo file_get_contents('inc.css'); $max = 0; foreach ($catalog as $item){ $max = max($item['sheet_x'], $max); $max = max($item['sheet_y'], $max); } $fact = 100 / $max; $sheet_size = $max 1; echo "span.emoji-inner { background-size: {$sheet_size}00%; }\n"; foreach ($catalog as $item){ $unilow = unicode_hex_chars($item['unified']); $pos_x = $item['sheet_x'] * $fact; $pos_y = $item['sheet_y'] * $fact; echo ".emoji$unilow { background-position: {$pos_x}% {$pos_y}% !important; }\n"; } function unicode_hex_chars($str){ $out = ''; $cps = explode('-', $str); foreach ($cps as $cp){这是一份emoji的表情转换PHP类库,需要的朋友可以下载使用
- 1
- 粉丝: 784
- 资源: 3万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助