Skip to content

Instantly share code, notes, and snippets.

@upsilon
Created November 1, 2013 07:15
Show Gist options
  • Select an option

  • Save upsilon/7261894 to your computer and use it in GitHub Desktop.

Select an option

Save upsilon/7261894 to your computer and use it in GitHub Desktop.
OpenPNE_KtaiEmoji::relation_list を json 形式にして出力する何か
<?php
$vendorPath = './lib/vendor';
set_include_path(get_include_path().PATH_SEPARATOR.$vendorPath);
require_once $vendorPath.'/OpenPNE2/KtaiEmoji.php';
$emoji = new OpenPNE_KtaiEmoji();
$relation_list = $emoji->relation_list;
// Docomo絵文字への変換分だけ出力
$output = array(
's' => array('i' => $relation_list['s']['i']),
'e' => array('i' => $relation_list['e']['i']),
);
echo <<<EOT
/**
* @copyright 2005-2008 OpenPNE Project
* @license http://www.php.net/license/3_01.txt PHP License 3.01
*/
EOT;
echo json_encode($output);
@upsilon
Copy link
Copy Markdown
Author

upsilon commented Nov 1, 2013

これを使ってクライアントサイドで絵文字 ([i:1] とか) を img 要素に変換できないかなといふ妄想

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment