A
A
adam_carraway2020-06-22 16:21:46
Laravel
adam_carraway, 2020-06-22 16:21:46

emoji validator?

How to remove emoji in php, except for the banal cut (like this https://stackoverflow.com/questions/35961245/how-t... Are there any other solutions? I use laravel

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nokimaro, 2020-06-22
@nokimaro

Cutting is normal. It should be understood that emoji is just a certain sequence of unicode characters that browsers automatically convert to an image.
To simplify even more, it is akin to icon fonts. Accordingly, if we want to remove emoji from the text, we need to remove these sequences of unicode characters: www.unicode.org/Public/emoji/1.0//emoji-data.txt

F
FreeThinker, 2020-07-10
@FreeThinker

Emoji is the same set of characters as just letters, numbers, etc., so only "cut". Another issue is the implementation: it is more correct to use a regular expression of emoji ranges, and not to shove everything into a heap, as indicated in the example. It seems like something similar here: https://stackoverflow.com/questions/12807176/php-w... - but there is only a quarter of the possible ranges.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question