function isMatchEmoji($str) { $pattern='/./u'; $rs=preg_match_all($pattern,$str,$match); if($rs>0){ foreach($match[0] as $m){ if(strlen($m) >= 4){ return true; } } } return false; } $str='ko👑🎤哈罗'; $rs=isMatchEmoji($str); echo $rs?'have emoji':'not have emoji';