= 4) { $strEncode .= '[[EMOJI:'.rawurlencode($_tmpStr).']]'; } else { $strEncode .= $_tmpStr; } } return $strEncode; } //对emoji表情转反义 public static function emoji_decode($str) { $strDecode = preg_replace_callback('|\[\[EMOJI:(.*?)\]\]|', function($matches){ return rawurldecode($matches[1]); }, $str); return $strDecode; } }