A better way to replace emoticons in PHP?

后端 未结 5 1532
忘掉有多难
忘掉有多难 2020-12-05 21:40

Right now I am using this function for emoticons:

function emoticons($text) {
        $icons = array(
                \':)\'    =>  \'

        
5条回答
  •  执念已碎
    2020-12-05 22:24

    I'd recommend two libraries:

    Emojify: https://github.com/HallgrenNetworks/emojify

    PHP Emoji: https://github.com/iamcal/php-emoji

    These will deal with these cases for you.

提交回复
热议问题