qiandu
public static function removeEmoji($text) {

    $clean_text = "";

    // Match Emoticons
    $regexEmoticons = \'/[\x{1F600}-\x{1F64F}]/u\';
    $clean_text = preg_replace($regexEmoticons, \'\', $text);

    // Match Miscellaneous Symbols and Pictographs
    $regexSymbols = \'/[\x{1F300}-\x{1F5FF}]/u\';
    $clean_text = preg_replace($regexSymbols, \'\', $clean_text);

    // Match Transport And Map Symbols
    $regexTransport = \'/[\x{1F680}-\x{1F6FF}]/u\';
    $clean_text = preg_replace($regexTransport, \'\', $clean_text);

    // Match Miscellaneous Symbols
    $regexMisc = \'/[\x{2600}-\x{26FF}]/u\';
    $clean_text = preg_replace($regexMisc, \'\', $clean_text);

    // Match Dingbats
    $regexDingbats = \'/[\x{2700}-\x{27BF}]/u\';
    $clean_text = preg_replace($regexDingbats, \'\', $clean_text);

    return $clean_text;
}

分类:

技术点:

相关文章:

  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-05-23
  • 2021-12-24
  • 2021-10-06
猜你喜欢
  • 2021-09-20
  • 2021-11-26
  • 2021-12-13
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
相关资源
相似解决方案