2017-04-07 1 views
1

유니 코드 이모티콘을 PHP 또는 JS 함수로 나열하려고하지만이를 수행 할 방법을 찾을 수 없습니다. Vim은 유니 코드 이모티콘을 잘 보여주지 않으며 캐릭터를 바꾸는 내 라인을 깨고 이상한 일을하기 때문에 붙여 넣기 만 할 수 없습니다.유니 코드 이모티콘을 나열하는 기능

유니 코드 코드 (예 : U + 1F600)를 사용하여 일부 증분을 수행 할 수 있다고 생각했지만 누군가이 방법을 설명 할 수 있습니까?

편집 : 내 나쁜

영어 편집 2, 영어 죄송합니다 몇 가지 고르세요 : 내 난로에이 기능을했다가 , 경우에 당신이 그것을 사용하려면, 내 손님 수!

<?php 
// Function used to get a list of emojis (Unicode) 
// She takes ranges of unicode decimal 
// Find hexadecimal here : http://apps.timwhitlock.info/emoji/tables/unicode 
// Convert in decimal here : http://www.binaryhexconverter.com/hex-to-decimal-converter 
// Already organised for my taste but fully customisable 
// Use larger ranges like 128512 - 130000 to see your Unicode Browser compatibilty 
// 
// @Mobidi 
function myEmojis($emojiRanges) { 

     $_result = array(); 

     foreach ($emojiRanges as $start => $end) 
     { 
       $current = $start; 
       while ($current != $end) { 
         $_result['Emoji n°'.$current.''] = mb_convert_encoding(pack("N*", $current), "UTF-8", "UTF-32BE"); 
         $current ++; 
       } 
     } 

     return $_result; 
} 
//Key = Start, Value = End. 
$emojiRangesCustom = array(
'128512' => '128590', 
'129296' => '129310', 
'129312' => '129319', 
'127744' => '128511', 
'128640' => '128705', 
'129296' => '129310', 
'129312' => '129319', 
'129360' => '129374', 
'129408' => '129425' 
); 
$emojiMerge = myEmojis($emojiRangesCustom); 

?> 
<div style="font-size:24px;text-align:justify"> 
     <?php 
     //While listing everything ! See you next time 
     foreach($emojiMerge as $keys => $emoji) { 
       echo '<a href="#" title="'.$keys.'">'.$emoji.'</a> '; 
     } 
     ?> 
</div> 

답변

4

사용을 PHP의 다른 버전이 table of emoj

을 당신은 json_decode

echo json_decode('"\uD83D\uDE00"'); 
     

하여 에코 안하지만 PHP를 사용하는 경우 7

이제 더 이상 필요 json_decode를 사용하고 \ u와 유니 코드 리터럴을 사용할 수 있습니다 :

,
echo "\u{1F30F}"; 

아니면 그냥 시도 사용할 수있는이 other 당신은 그냥 = "이름"클래스를 변경 그리고 그것은 당신의 대답에 대한 emoj에게

+0

덕분에 많이 발생하는 것입니다 GitHub의에서 다운로드해야하고 프로젝트에 포함 , 첫 번째 링크에서 많은 정보를 발견했습니다. – Mobidi

+0

아버지, 제가 기능을 만들었습니다. 제게 잘 생겼다고 말해주세요! – Mobidi

+0

그래, 좋아. –

관련 문제