Home>

When you check the above things on the net, you will often see the following description.

preg_replace ("/ [\ xF0- \ xF7] [\ x80- \ xBF] [\ x80- \ xBF] [\ x80- \ xBF] /", "", $str);

This can delete 4Byte emoji, but it seems not enough.

For example, the following 3 byte pictograms cannot be deleted.

<? php
$str = "☔️";
echo $str;// "☔️"
$str = preg_replace ("/ [\ xF0- \ xF7] [\ x80- \ xBF] [\ x80- \ xBF] [\ x80- \ xBF] /", "", $str);
echo $str;// "☔️"
?>

In addition, gender symbols will remain in pictograms that have gender expressions, such as those running on 4-byte pictograms.


				
				
	
php
  • Answer # 1

    First, remove basic emoji.

    $str = "

Related articles

Trends