📙 Emojipedia — 😃 Home of Emoji Meanings 💁👌🎍😍

8112 人参与 | 时间:2024年04月25日 02:34:24
点击跳转 emojipedia.org
内容

https://unicode.org/Public/emoji/11.0/emoji-data.txt
https://unicode.org/emoji/charts/emoji-list.html
https://unicode.org/emoji/charts/index。 HTML


<?php 
$content = file_get_contents('emoji.json');
$content = json_decode($content, 1);
echo '<pre>';
$data = array();
$category = array();
foreach ($content as $key => $vo) {
if (in_array($vo['category'], array('Flags', 'Symbols', 'Objects'))) {
continue;
}
if (!isset($data[$vo['category']])) {
$category[] = $vo['category'];
}
$data[$vo['category']][] = $vo;
}
$shuju = array();
$fanyi = array();
$fanyi_text = file_get_contents('1.txt');
$fanyi_arr = explode("\r\n", $fanyi_text);
$i = 0;
foreach ($data as $key => $vo) {
$category = array();
//$category['title'] = $key;
$category['title'] = $key;
$fanyi[] = $key;
//子数据
$i++;
foreach ($vo as $k => $v) {
$child = array();
$child['code'] = $v['codes'];
$child['char'] = $v['char'];
$child['title'] = $v['name'];
// $child['title'] = $fanyi_arr[$i];;
//获取翻译数据
$fanyi[] = $v['name'];
$category['data'][] = $child;
$i++;
}
$shuju[] = $category;
}
/**
* 显示翻译数据
*/
// foreach ($fanyi as $key => $vo) {
// $str .= $vo . '<br>';
// }
//print_r($fanyi);
/**
* 显示最终结果
*/
//print_r($shuju);
file_put_contents('emoji.txt', json_encode($shuju, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));